Ver Fonte

优化代码

蓝色星空 há 1 ano atrás
pai
commit
a039b4f346

+ 3 - 3
Assets/Scripts/Blue/0.FrameworkDesign/Util/SingletonMonobehaviour.cs

@@ -11,13 +11,13 @@ namespace Blue
             get => _instance;
         }
 
-        public virtual void OnStart() { }
-        private void Start()
+        public virtual void OnAwake() { }
+        private void Awake()
         {
             if (_instance == null)
             {
                 _instance = this.GetComponent<T>();
-                _instance.OnStart();
+                _instance.OnAwake();
                 DontDestroyOnLoad(_instance);
             }
             else

+ 7 - 1
Assets/Scripts/Blue/Controller/WarningPopUpController.cs

@@ -1,13 +1,19 @@
 using UnityEngine;
 
 public class WarningPopUpController :MonoBehaviour
-{ 
+{
     private void Start()
     {
         Invoke("Active",3);
     }
     private void Active()
     {
+        // 关闭加载界面
+        if(InstantiateSystem.Instance.objDic.TryGetValue("LoadingPanel(Clone)",out GameObject LoadingPanel))
+        {
+            if (LoadingPanel.activeSelf)
+                LoadingPanel.SetActive(false);
+        }
         Destroy(gameObject);
     }
 }