Пример #1
0
        private static void CreateDefaultGo(GameRunningStage stage)
        {
            var go = new GameObject("DefaultGo" + stage);

//		   go.AddComponent<Canvas>().enabled = false;
            MoveToStageScene(stage, go);

            _defaultParents[(int)_stage] = go;
        }
Пример #2
0
        private static void MoveToStageScene(GameRunningStage stage, GameObject go)
        {
            for (int i = 0; i < SceneManager.sceneCount; i++)
            {
                var scene = SceneManager.GetSceneAt(i);
                if (scene.name.StartsWith(TargetScene[(int)stage]))
                {
                    SceneManager.MoveGameObjectToScene(go, scene);

                    break;
                }
            }
        }
Пример #3
0
 public static void SetStage(GameRunningStage stage, bool clearOthers)
 {
     _stage = stage;
     if (clearOthers)
     {
         for (int i = 0; i < _defaultParents.Length; i++)
         {
             if (i != (int)stage)
             {
                 _defaultParents[i] = null;
             }
         }
     }
 }
Пример #4
0
 public static void Clear(GameRunningStage stage)
 {
     _defaultParents[(int)stage] = null;
 }