Esempio n. 1
0
File: CObject.cs Progetto: scris/_GS
    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
    }
Esempio n. 2
0
File: CObject.cs Progetto: scris/_GS
    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
    }
Esempio n. 3
0
    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);
            }
        });
    }