Skip to content

Commit

Permalink
First version
Browse files Browse the repository at this point in the history
  • Loading branch information
Valian committed Oct 29, 2014
1 parent 7ddd692 commit f488d49
Show file tree
Hide file tree
Showing 4 changed files with 181 additions and 0 deletions.
22 changes: 22 additions & 0 deletions UnityDebugger.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.21005.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnityDebugger", "UnityDebugger\UnityDebugger.csproj", "{E7B3915E-F708-4BE2-B4E0-D41E2C5D11FE}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{E7B3915E-F708-4BE2-B4E0-D41E2C5D11FE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E7B3915E-F708-4BE2-B4E0-D41E2C5D11FE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E7B3915E-F708-4BE2-B4E0-D41E2C5D11FE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E7B3915E-F708-4BE2-B4E0-D41E2C5D11FE}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
72 changes: 72 additions & 0 deletions UnityDebugger/Debugger.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
using System;
using Debug = UnityEngine.Debug;
using Object = UnityEngine.Object;

namespace UnityDebugger
{
public class Debugger
{
#region Asserts

public static void Assert(bool statement, string name = "Assert")
{
if (Debug.isDebugBuild && !statement)
{
throw new Exception(name + " is false!");
}
}

public static void AssertNotNull(object obj, string name, Object context)
{
if (Debug.isDebugBuild && obj == null)
{
Debug.LogError(name + " in object " + context.name + " ( " + context.GetType() + " ) is null!");
}
}

public static void AssertNotNull(Object obj, string name, Object context)
{
if (Debug.isDebugBuild && obj == null)
{
Debug.LogError(name + " in object " + context.name + " ( " + context.GetType() + " ) is null!");
}
}

#endregion

#region Logging

public static void Log(string message)
{
if (Debug.isDebugBuild)
{
Debug.Log(message);
}
}

public static void LogWarning(string message)
{
if (Debug.isDebugBuild)
{
Debug.LogWarning(message);
}
}

public static void LogError(string message)
{
if (Debug.isDebugBuild)
{
Debug.LogError(message);
}
}
public static void LogException(Exception exception)
{
if (Debug.isDebugBuild)
{
Debug.LogException(exception);
}
}

#endregion
}
}
36 changes: 36 additions & 0 deletions UnityDebugger/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("UnityDebugger")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("UnityDebugger")]
[assembly: AssemblyCopyright("Copyright © 2014")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("b80928d3-8e78-4584-ae52-51edf89ef530")]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
51 changes: 51 additions & 0 deletions UnityDebugger/UnityDebugger.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{E7B3915E-F708-4BE2-B4E0-D41E2C5D11FE}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>UnityDebugger</RootNamespace>
<AssemblyName>UnityDebugger</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="UnityEngine">
<HintPath>..\..\..\..\..\Development Programs\Unity 4.6\Editor\Data\Managed\UnityEngine.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Debugger.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

0 comments on commit f488d49

Please sign in to comment.