Ejemplo n.º 1
0
 private void OnEnable()
 {
     this.titleContent = new GUIContent("Start Scene");
     if (File.Exists(path))
     {
         this.data = JsonHelper.FromJson <AlwaysLoadSceneWindowData>(File.ReadAllText(path));
     }
     else
     {
         this.data = new AlwaysLoadSceneWindowData();
         Save();
     }
 }
Ejemplo n.º 2
0
 private static void OnGameEnter()
 {
     if (File.Exists(path))
     {
         AlwaysLoadSceneWindowData data = JsonHelper.FromJson <AlwaysLoadSceneWindowData>(File.ReadAllText(path));
         if (data.isEnabled == true && string.IsNullOrEmpty(data.initSceneName) == false)
         {
             if (SceneManager.GetActiveScene().name != data.initSceneName)
             {
                 SceneManager.LoadScene(data.initSceneName);
             }
         }
     }
 }