예제 #1
0
        void Awake()
        {
            RootGroup_ = new DebugGroupItem("Debugger");
            RootGroup_.Register("Log", new LogDebuggerItem());

            RootGroup_.Register("Info/System", new DebuggerInfo.SystemItem());
            RootGroup_.Register("Info/Environment", new DebuggerInfo.EnvironmentItem());
            RootGroup_.Register("Info/Screen", new DebuggerInfo.ScreenItem());
            RootGroup_.Register("Info/Graphics", new DebuggerInfo.GraphicsItem());
            RootGroup_.Register("Info/Input", new DebuggerInfo.InputItem());
            RootGroup_.Register("Info/Other", new DebuggerInfo.OtherItem());

            RootGroup_.Register("Setting", new SettingDebuggerItem());

            RootGroup_.Register("Profiler/Summary", new DebuggerProfiler.SummerItem());
            RootGroup_.Register("Profiler/Memory/Summary", new DebuggerProfiler.MemorySummaryItem());
            RootGroup_.Register("Profiler/Memory/All", new DebuggerProfiler.MemoryInfoItem <UnityEngine.Object>());
            RootGroup_.Register("Profiler/Memory/Texture", new DebuggerProfiler.MemoryInfoItem <UnityEngine.Texture>());
            RootGroup_.Register("Profiler/Memory/Mesh", new DebuggerProfiler.MemoryInfoItem <UnityEngine.Mesh>());
            RootGroup_.Register("Profiler/Memory/Material", new DebuggerProfiler.MemoryInfoItem <UnityEngine.Material>());
            RootGroup_.Register("Profiler/Memory/Shader", new DebuggerProfiler.MemoryInfoItem <UnityEngine.Shader>());
            RootGroup_.Register("Profiler/Memory/AnimationClip", new DebuggerProfiler.MemoryInfoItem <UnityEngine.AnimationClip>());
            RootGroup_.Register("Profiler/Memory/AudioClip", new DebuggerProfiler.MemoryInfoItem <UnityEngine.AudioClip>());
            RootGroup_.Register("Profiler/Memory/Font", new DebuggerProfiler.MemoryInfoItem <UnityEngine.Font>());
            RootGroup_.Register("Profiler/Memory/TextAsset", new DebuggerProfiler.MemoryInfoItem <UnityEngine.TextAsset>());
            RootGroup_.Register("Profiler/Memory/ScriptableObject", new DebuggerProfiler.MemoryInfoItem <UnityEngine.ScriptableObject>());

            RootGroup_.Register("Profiler/Object Pool", new DebuggerProfiler.ObjectPoolItem());

            ResetLayout();
        }
예제 #2
0
        // I
        // A/B1
        // A/B2
        // A/B1/C1
        public void Register(string Path, IDebuggerDrawItem Item)
        {
            var Paths = Path.Split('/');

            if (Paths.Length == 1)
            {
                Item.Name = Path;
                ItemList_.Add(Path, Item);
                return;
            }

            if (!ItemList_.ContainsKey(Paths[0]))
            {
                var GroupItem = new DebugGroupItem(Paths[0]);
                GroupItem.Register(Path.Substring(Paths[0].Length + 1), Item);
                ItemList_.Add(Paths[0], GroupItem);
            }
            else if (ItemList_[Paths[0]] is DebugGroupItem DItem)
            {
                DItem.Register(Path.Substring(Paths[0].Length + 1), Item);
            }
            else
            {
                var GroupItem = new DebugGroupItem(Paths[0]);
                GroupItem.Register(ItemList_[Paths[0]].Name, ItemList_[Paths[0]]);
                GroupItem.Register(Path.Substring(Paths[0].Length + 1), Item);
                ItemList_[Paths[0]] = GroupItem;
            }
        }