示例#1
0
        public static bool InspectInspector()
        {
            var changed = false;

            if ("Coroutines [{0}]".F(QcAsync.GetActiveCoroutinesCount).enter(ref inspectedSection, 0).nl())
            {
                QcAsync.InspectManagedCoroutines().nl(ref changed);
            }

            "Screen Shots".enter_Inspect(screenShots, ref inspectedSection, 1).nl(ref changed);

            "Json Inspector".enter_Inspect(jsonInspector, ref inspectedSection, 2).nl();

            if ("ICfg Inspector".enter(ref inspectedSection, 3).nl())
            {
                iCfgExplorer.Inspect(null).nl(ref changed);
            }

            if (inspectedSection == -1)
            {
                if ("Player Data Folder".Click().nl())
                {
                    QcFile.ExplorerUtils.OpenPersistentFolder();
                }

                if (Application.isEditor && "Editor Data Folder".Click().nl())
                {
                    QcFile.ExplorerUtils.OpenPath("C:/Users/{0}/AppData/Local/Unity/Editor/Editor.log".F(Environment.UserName));
                }
            }

            return(changed);
        }
示例#2
0
        public virtual bool Inspect()
        {
            var changed = false;

            if (!icon.Debug.enter(ref inspectedItems, 0))
            {
                return(false);
            }

            if (icon.Refresh.Click("Reset Inspector"))
            {
                ResetInspector();
            }

            this.ClickHighlight();

            pegi.nl();

            if ("Configs: ".AddCount(explorer).enter(ref _inspectedDebugItems, 0).nl())
            {
                explorer.Inspect(this);
            }

            if (inspectedItems == -1)
            {
                pegi.nl();
            }

            if (("Object References: " + nestedReferences.Count).enter(ref _inspectedDebugItems, 1).nl())
            {
                _listMetaData.edit_List_UObj(ref nestedReferences);

                if (inspectedReference == -1 && "Clear All References".Click("Will clear the list. Make sure everything" +
                                                                             ", that usu this object to hold references is currently decoded to avoid mixups"))
                {
                    nestedReferences.Clear();
                }
            }

            if (inspectedItems == -1)
            {
                pegi.nl();
            }

            if (("Unrecognized Tags: " + UnrecognizedStd.Count).enter(ref _inspectedDebugItems, 2).nl_ifNotEntered())
            {
                UnrecognizedStd.Nested_Inspect(ref changed);
            }

            if (inspectedItems == -1)
            {
                pegi.nl();
            }


            return(changed);
        }
示例#3
0
        public virtual bool Inspect()
        {
            var changed = false;

            if (icon.Debug.enter(ref _inspectedItems, 0))
            {
                if (icon.Refresh.Click("Reset Inspector"))
                {
                    ResetInspector();
                }
                this.CopyPasteStdPegi().nl(ref changed);

                _explorer.Inspect(this);
                changed |= UnrecognizedStd.Nested_Inspect();
            }

            return(changed);
        }
示例#4
0
        public virtual bool Inspect()
        {
            var changed = false;

            if (inspectedItems == -1)
            {
                pegi.EditorView.Lock_UnlockClick(gameObject);
            }

            if (!icon.Debug.enter(ref inspectedItems, 0).nl(ref changed))
            {
                return(changed);
            }



            "{0} Debug ".F(this.GetNameForInspector()).write(90);

            pegi.toggleDefaultInspector(this);

            if (icon.Refresh.Click("Reset Inspector"))
            {
                ResetInspector();
            }

            this.CopyPasteStdPegi().nl(ref changed);

            if (("Cfg Saves: " + explorer.CountForInspector()).enter(ref _inspectedDebugItems, 0).nl())
            {
                explorer.Inspect(this);
            }

            if (inspectedItems == -1)
            {
                pegi.nl();
            }

            if (("Object References: " + nestedReferences.Count).enter(ref _inspectedDebugItems, 1).nl_ifNotEntered())
            {
                referencesMeta.edit_List_UObj(ref nestedReferences);
                if (!referencesMeta.Inspecting && "Clear All References".Click("Will clear the list. Make sure everything" +
                                                                               ", that usu this object to hold references is currently decoded to avoid mixups"))
                {
                    nestedReferences.Clear();
                }
            }

            if (inspectedItems == -1)
            {
                pegi.nl();
            }

            if (("Unrecognized Tags: " + UnrecognizedStd.Count).enter(ref _inspectedDebugItems, 2).nl_ifNotEntered())
            {
                UnrecognizedStd.Nested_Inspect().changes(ref changed);
            }

            if ("Inspect Inspector".enter(ref _inspectedDebugItems, 3).nl())
            {
                QcUtils.InspectInspector();
            }

            if (inspectedItems == -1)
            {
                pegi.nl();
            }


            return(changed);
        }
        public static bool InspectInspector()
        {
            var changed = false;

            if ("Coroutines [{0}]".F(QcAsync.GetActiveCoroutinesCount).enter(ref inspectedSection, 0).nl())
            {
                QcAsync.InspectManagedCoroutines().nl(ref changed);
            }

            "Screen Shots".enter_Inspect(screenShots, ref inspectedSection, 1).nl(ref changed);

            "Json Inspector".enter_Inspect(jsonInspector, ref inspectedSection, 2).nl();

            if ("ICfg Inspector".enter(ref inspectedSection, 3).nl())
            {
                iCfgExplorer.Inspect(null).nl(ref changed);
            }

            if ("Gui Styles".enter(ref inspectedSection, 4).nl())
            {
                PEGI_Styles.Inspect().nl();
            }

            if ("Data".enter(ref inspectedSection, 5).nl())
            {
                if (inspectedData == -1)
                {
                    if ("Player Data Folder".Click().nl())
                    {
                        QcFile.Explorer.OpenPersistentFolder();
                        pegi.SetCopyPasteBuffer(Application.persistentDataPath, sendNotificationIn3Dview: true);
                    }

                    if (Application.isEditor && "Editor Data Folder".Click().nl())
                    {
                        QcFile.Explorer.OpenPath(
                            "C:/Users/{0}/AppData/Local/Unity/Editor/Editor.log".F(Environment.UserName));
                    }
                }

                if ("Cache".enter(ref inspectedData, 1).nl())
                {
                    if ("Caching.ClearCache() [{0}]".F(Caching.cacheCount).ClickConfirm("clCach").nl())
                    {
                        if (Caching.ClearCache())
                        {
                            pegi.GameView.ShowNotification("Bundles were cleared");
                        }
                        else
                        {
                            pegi.GameView.ShowNotification("ERROR: Bundles are being used");
                        }
                    }

                    List <string> lst = new List <string>();

                    Caching.GetAllCachePaths(lst);

                    "Caches".edit_List(ref lst, path =>
                    {
                        var c = Caching.GetCacheByPath(path);

                        if (icon.Delete.Click())
                        {
                            if (Caching.RemoveCache(c))
                            {
                                pegi.GameView.ShowNotification("Bundle was cleared");
                            }
                            else
                            {
                                pegi.GameView.ShowNotification("ERROR: Bundle is being used");
                            }
                        }

                        if (icon.Folder.Click())
                        {
                            QcFile.Explorer.OpenPath(path);
                        }

                        if (icon.Copy.Click())
                        {
                            pegi.SetCopyPasteBuffer(path);
                        }

                        path.write();

                        return(path);
                    });
                }
            }

            if ("Profiler".enter(ref inspectedSection, 6).nl())
            {
                "Mono Heap Size Long {0}".F(Profiler.GetMonoHeapSizeLong().ToMegabytes()).nl();

                "Mono Used Size Long {0}".F(Profiler.GetMonoUsedSizeLong().ToMegabytes()).nl();

                "Temp Allocated Size {0}".F(Profiler.GetTempAllocatorSize().ToMegabytes()).nl();

                "Total Allocated Memmory Long {0}".F(Profiler.GetTotalAllocatedMemoryLong().ToMegabytes()).nl();

                "Total Unused Reserved Memmory Long {0}".F(Profiler.GetTotalUnusedReservedMemoryLong().ToMegabytes()).nl();

                if ("Unload Unused Assets".Click().nl())
                {
                    Resources.UnloadUnusedAssets();
                }
            }

            if ("Time & Audio".enter(ref inspectedSection, 7).nl())
            {
                "Time.time: {0}".F(QcSharp.SecondsToReadableString(Time.time)).nl();

                "AudioSettings.dspTime: {0}".F(QcSharp.SecondsToReadableString(AudioSettings.dspTime)).nl();

                "Use it to schedule Audio Clips: audioSource.PlayScheduled(AudioSettings.dspTime + 0.5);".writeHint();

                "Clip Duration: double duration = (double)AudioClip.samples / AudioClip.frequency;".writeHint();

                "Time.unscaled time: {0}".F(QcSharp.SecondsToReadableString(Time.unscaledTime)).nl();

                "Time.frameCount: {0}".F(Time.frameCount).nl();

                var tScale = Time.timeScale;
                if ("Time.timescale".edit(ref tScale, 0f, 4f))
                {
                    Time.timeScale = tScale;
                }

                if (tScale != 1 && icon.Refresh.Click())
                {
                    Time.timeScale = 1;
                }

                pegi.nl();

                "Time.deltaTime: {0}".F(QcSharp.SecondsToReadableString(Time.deltaTime)).nl();

                "Time.realtimeSinceStartup {0}".F(QcSharp.SecondsToReadableString(Time.realtimeSinceStartup)).nl();

                var fr = Application.targetFrameRate;
                if ("Frame-Rate".edit(ref fr).nl() && fr > 0)
                {
                    Application.targetFrameRate = fr;
                }
            }

            return(changed);
        }