Exemplo n.º 1
0
    private GameObject _MakeRootSceneGO(TsSceneSwitcher.ESceneType eSceneType)
    {
        GameObject gameObject = this._GetSwitchData_RootSceneGO(eSceneType);

        if (gameObject == null)
        {
            gameObject = new GameObject(eSceneType.ToString());
            TsSceneSwitcherMark tsSceneSwitcherMark = this._AddOrGetComponent(gameObject, eSceneType);
            tsSceneSwitcherMark.RootGOName  = eSceneType.ToString();
            tsSceneSwitcherMark.IsCollected = true;
            TsSceneSwitcher._SwitchDataList value = new TsSceneSwitcher._SwitchDataList();
            this._switchDataDic.Add(gameObject, value);
            gameObject.transform.parent = TsSceneSwitcher.Instance.gameObject.transform;
            UnityEngine.Object.DontDestroyOnLoad(gameObject);
        }
        return(gameObject);
    }
Exemplo n.º 2
0
 private TsSceneSwitcher._SwitchDataList _GetSwitchData_List(TsSceneSwitcher.ESceneType eSceneType)
 {
     foreach (KeyValuePair <GameObject, TsSceneSwitcher._SwitchDataList> current in this._switchDataDic)
     {
         if (current.Key.name.Equals(eSceneType.ToString()))
         {
             return(current.Value);
         }
     }
     return(null);
 }
Exemplo n.º 3
0
 public GameObject _GetSwitchData_RootSceneGO(TsSceneSwitcher.ESceneType eSceneType)
 {
     foreach (GameObject current in this._switchDataDic.Keys)
     {
         if (current.name.Equals(eSceneType.ToString()))
         {
             return(current);
         }
     }
     return(null);
 }