From 710a9ccfe66491c4cf9def5224cb2250550bcd41 Mon Sep 17 00:00:00 2001 From: ninemine <1371605831@qq.com> Date: Thu, 4 Dec 2025 16:27:03 +0800 Subject: [PATCH] Tab --- .../Framework/GameContent/GameController.cs | 26 ++----------------- Assets/Scripts/Framework/RootObject.cs | 1 - Assets/Scripts/Framework/ScriptableObject.cs | 18 +++++++++---- 3 files changed, 15 insertions(+), 30 deletions(-) diff --git a/Assets/Scripts/Framework/GameContent/GameController.cs b/Assets/Scripts/Framework/GameContent/GameController.cs index e6cdd1f..0f1c1e0 100644 --- a/Assets/Scripts/Framework/GameContent/GameController.cs +++ b/Assets/Scripts/Framework/GameContent/GameController.cs @@ -85,30 +85,6 @@ namespace Demo.Game } if (string.IsNullOrEmpty(clipPath) == false) { - /* - IEnumerator Run() - { -#if ENABLE_CLASS_Interaction - var clipFile = new Interaction(clipPath); -#else - var clipFile = new ToolFile(clipPath); -#endif - if (clipFile.Exists() == false) - clipFile = new(MainConfig.GetFile(clipPath).GetFullPath()); - if (clipFile.Exists() == false) - { - Debug.LogError($"Cannt load {clipPath}", this); - yield break; - } - yield return MainAudio.LoadAudio(clipFile, audioType); - content.SongLoadOverCallback(MainAudio); - yield return GameAudioSystemInit(); - } - - StartCoroutine(Run()); - */ - - #if ENABLE_CLASS_Interaction var clipFile = new Interaction(clipPath); #else @@ -139,6 +115,8 @@ namespace Demo.Game { // Config ScriptableObject { + ScriptableObject.EnableScriptableObjectCounter = 0; + ScriptableObject.ApplyScriptableObjectCounter = 0; ScriptableObject.FastScriptableObjectTypen = content.ScriptableObjectTypen; ScriptableObject.IsAutoPlay = content.IsAutoPlay; ScriptableObject.OneBarTime = 60.0f / (float)MainConfig.FindItem(nameof(Editor.EditorController.BPM), Editor.EditorController.instance.BPM); diff --git a/Assets/Scripts/Framework/RootObject.cs b/Assets/Scripts/Framework/RootObject.cs index cc6a326..cf99b0e 100644 --- a/Assets/Scripts/Framework/RootObject.cs +++ b/Assets/Scripts/Framework/RootObject.cs @@ -40,7 +40,6 @@ namespace Demo.Game public void EnableScript(string sourcePath, GameController parent) { - AllScriptableObjectCounter = 0; if (AllScriptableObjectCounterHierarchyItem == null) { AllScriptableObjectCounterHierarchyItem = HierarchyWindow.instance.CreateRootItemEntryWithBinders(typeof(ScriptableObject))[0]; diff --git a/Assets/Scripts/Framework/ScriptableObject.cs b/Assets/Scripts/Framework/ScriptableObject.cs index e718534..bf22b8f 100644 --- a/Assets/Scripts/Framework/ScriptableObject.cs +++ b/Assets/Scripts/Framework/ScriptableObject.cs @@ -270,6 +270,12 @@ namespace Demo MyHierarchyItem.GetHierarchyItem().title = this.ScriptName + $"<{m_ScriptType}>"; MyHierarchyItem.GetHierarchyItem().target = this; MyHierarchyItem.GetHierarchyItem().ButtonGameObject.GetComponent().ScriptObjectMenu = OnHierarchyItemRightClick; + + // 增数 + { + EnableScriptableObjectCounter++; + AllScriptableObjectCounterHierarchyItem.GetHierarchyItem().text = $"SOC: {ApplyScriptableObjectCounter}/{EnableScriptableObjectCounter}"; + } } #region Hierarchy @@ -295,7 +301,8 @@ namespace Demo public partial class ScriptableObject { public static Dictionary FastScriptableObjectTypen = new(); - public static int AllScriptableObjectCounter = 0; + public static int EnableScriptableObjectCounter = 0; + public static int ApplyScriptableObjectCounter = 0; public bool IsParseScript2Expr { get; private set; } = false; protected virtual bool IsSelfEnableUpdate { get => true; } @@ -478,8 +485,8 @@ namespace Demo yield return DoSomethingDuringApplyScript(); // 增数 { - AllScriptableObjectCounter++; - AllScriptableObjectCounterHierarchyItem.GetHierarchyItem().text = $"ScriptableObjectCount: {AllScriptableObjectCounter}"; + ApplyScriptableObjectCounter++; + AllScriptableObjectCounterHierarchyItem.GetHierarchyItem().text = $"SOC: {ApplyScriptableObjectCounter}/{EnableScriptableObjectCounter}"; } // 统计更新能力 { @@ -511,8 +518,9 @@ namespace Demo // 清理Cache // // 减数 - AllScriptableObjectCounter--; - AllScriptableObjectCounterHierarchyItem.GetHierarchyItem().text = $"ScriptableObjectCount: {AllScriptableObjectCounter}"; + ApplyScriptableObjectCounter--; + EnableScriptableObjectCounter++; + AllScriptableObjectCounterHierarchyItem.GetHierarchyItem().text = $"SOC: {ApplyScriptableObjectCounter}/{EnableScriptableObjectCounter}"; } if (MyHierarchyItem != null) {