public static void StartWatch(object obj) { #if COBJECT_DEBUGGER if (!CDebug.IsEditor || !Application.isPlaying || IsApplicationQuited) { return; } CAsync.AddMainThreadCall(() => { try { var newDebugger = new GameObject(string.Format("{0}-{1}", obj.ToString(), obj.GetType())).AddComponent <CObjectDebugger>(); newDebugger.WatchObject = obj; CDebuggerObjectTool.SetParent(ContainerName, obj.GetType().Name, newDebugger.gameObject); Cache[obj] = newDebugger; } catch (Exception e) { CDebug.LogError(e.Message); } }); #endif }
public static void StopWatch(object obj) { #if COBJECT_DEBUGGER if (!CDebug.IsEditor || !Application.isPlaying || IsApplicationQuited) { return; } CAsync.AddMainThreadCall(() => { try { CObjectDebugger debuger; if (CObjectDebugger.Cache.TryGetValue(obj, out debuger)) { GameObject.Destroy(debuger.gameObject); } } catch (Exception e) { CDebug.LogError(e.Message); } }); #endif }
public static void StopWatch(object obj) { CAsync.AddMainThreadCall(() => { try { if (!CDebug.IsEditor) { return; } CObjectDebugger debuger; if (CObjectDebugger.Cache.TryGetValue(obj, out debuger)) { GameObject.Destroy(debuger.gameObject); } } catch (Exception e) { CDebug.LogError(e.Message); } }); }