From 63f412e9ade9183f2db3f09adf7d6e2e61426c8d Mon Sep 17 00:00:00 2001 From: hwrose Date: Tue, 19 Oct 2021 13:52:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=80=E4=BA=9B=E5=B0=8F?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Assets/Dependencies/JEngine/Core/Mgrs/ClassBindMgr.cs | 4 ++++ UnityProject/Assets/Scripts/InitJEngine.cs | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/UnityProject/Assets/Dependencies/JEngine/Core/Mgrs/ClassBindMgr.cs b/UnityProject/Assets/Dependencies/JEngine/Core/Mgrs/ClassBindMgr.cs index eb171cda..94162d58 100644 --- a/UnityProject/Assets/Dependencies/JEngine/Core/Mgrs/ClassBindMgr.cs +++ b/UnityProject/Assets/Dependencies/JEngine/Core/Mgrs/ClassBindMgr.cs @@ -34,6 +34,10 @@ public class ClassBindMgr : MonoBehaviour { public static void Instantiate() { + var _BindMgr = FindObjectOfType(); + if (_BindMgr != null) + return; + _instance = new GameObject("ClassBindMgr").AddComponent(); DontDestroyOnLoad(_instance); } diff --git a/UnityProject/Assets/Scripts/InitJEngine.cs b/UnityProject/Assets/Scripts/InitJEngine.cs index d88bf786..9b84d16b 100644 --- a/UnityProject/Assets/Scripts/InitJEngine.cs +++ b/UnityProject/Assets/Scripts/InitJEngine.cs @@ -46,8 +46,11 @@ private void Awake() Instance = this; DontDestroyOnLoad(gameObject); + GameStats.Initialize(); + GameStats.Debug = debug; AssetMgr.Loggable = debug; + Updater.OnAssetsInitialized = (gameScene,onProgress) => { Assets.AddSearchPath("Assets/HotUpdateResources/Controller"); @@ -72,8 +75,6 @@ private void Awake() public void Load() { - GameStats.Debug = debug; - GameStats.Initialize(); LoadHotFixAssembly(); }