Exemplo n.º 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);
        }
Exemplo n.º 2
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 ("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);
        }