123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130 |
- //#if UNITY_IPHONE&&!UNITY_EDITOR
- using System;
- using UnityEngine;
- public class YmDebug
- {
- //TODO wait for the global debug
- static public bool EnableDebug = true;
-
- static public void Log (string context)
- {
- if (EnableDebug) {
- Debug.Log (context);
- }
- }
- /// Output the Class Name
- static public void Log (object obj, string context)
- {
- Log (string.Format("[{0}] {1}", obj.GetType().Name, context));
- }
- /// Log the message by Color - Green
- static public void LogCG (string context)
- {
- if (EnableDebug) {
- Debug.Log (string.Format("<color=Green>{0}</color>",context));
- }
- }
- /// Output the Class Name And Log the message by Color - Green
- static public void LogCG (object obj, string context)
- {
- LogCG (string.Format("[{0}] {1}", obj.GetType().Name, context));
- }
- /// Log the message by Color - Red
- static public void LogCR (string context)
- {
- if (EnableDebug) {
- Debug.Log (string.Format("<color=#d04545>{0}</color>",context));
- }
- }
- /// Output the Class Name And Log the message by Color - Red
- static public void LogCR (object obj, string context)
- {
- LogCR (string.Format("[{0}] {1}", obj.GetType().Name, context));
- }
- static public void LogWarning (string context)
- {
- if (EnableDebug) {
- Debug.LogWarning (context);
- }
- }
- static public void LogError (string context)
- {
- if (EnableDebug) {
- Debug.LogError (context);
- }
- }
- public static void LogException (Exception exception)
- {
- Debug.LogException (exception);
- }
- public static void LogException (Exception exception, UnityEngine.Object context)
- {
- Debug.LogException (exception, context);
- }
- public static void DrawLine (Vector3 start, Vector3 end)
- {
- Debug.DrawLine (start, end);
- }
- public static void DrawLine (Vector3 start, Vector3 end, UnityEngine.Color color)
- {
- Debug.DrawLine (start, end, color);
- }
- public static void DrawLine (Vector3 start, Vector3 end, Color color, float duration)
- {
- Debug.DrawLine (start, end, color, duration);
- }
- public static void DrawLine (Vector3 start, Vector3 end, Color color, float duration, bool depthTest)
- {
- Debug.DrawLine (start, end, color, duration, depthTest);
- }
- public static void DrawRay (Vector3 start, Vector3 dir)
- {
- Debug.DrawRay (start, dir);
- }
- public static void DrawRay (Vector3 start, Vector3 dir, Color color)
- {
- Debug.DrawRay (start, dir, color);
- }
- public static void DrawRay (Vector3 start, Vector3 dir, Color color, float duration)
- {
- Debug.DrawRay (start, dir, color, duration);
- }
- public static void DrawRay (Vector3 start, Vector3 dir, Color color, float duration, bool depthTest)
- {
- Debug.DrawRay (start, dir, color, duration, depthTest);
- }
- public static void Break ()
- {
- Debug.Break ();
- }
- public static void ClearDeveloperConsole ()
- {
- Debug.ClearDeveloperConsole ();
- }
- public static void DebugBreak ()
- {
- Debug.DebugBreak ();
- }
- }
- //#endif
|