Пример #1
0
 protected virtual void Join()
 {
     if (tree != null)
     {
         Mgr.AddTree(this);
     }
 }
Пример #2
0
 public override void Do()
 {
     if (isLoaded)
     {
         return;
     }
     isLoaded = true;
     Mgr.postMains.Enqueue(() =>
     {
         Mgr.RemoveEntities();
         Mgr.singleInstance.StartCoroutine(LoadScene(identity.value));
     });
 }
Пример #3
0
 public override void Do()
 {
     if (isRuned)
     {
         return;
     }
     isRuned = true;
     Mgr.postMains.Enqueue(() =>
     {
         SceneManager.sceneLoaded += onLoaded;
         Mgr.RemoveEntities();
         SceneManager.LoadScene(identity.value);
     });
 }
Пример #4
0
 private void Awake()
 {
     idx = ++idx;
     if (idx == 1)
     {
         singleInstance = this;
         DontDestroyOnLoad(gameObject);
         driver.Init();
         driver.onBeforeRun += RunMainDo;
         driver.onBeforeRun += PostMain;
         InitWorkers();
         driver.onTreeAdded.Insert(0, RepleaseProxyTree);
         driver.useMulThread = useMulThread;
         foreach (var item in GetComponentsInChildren <UnityEntity>())
         {
             item.notDestroyOnLoad = true;
         }
     }
     else
     {
         Destroy(gameObject);
     }
 }