Exemplo n.º 1
0
 public void OnApplicationQuit()
 {
     SceneManager.activeSceneChanged -= SceneManagerOnActiveSceneChanged;
     SceneManager.sceneLoaded        -= SceneManager_sceneLoaded;
     calCounter = null;
     display    = null;
     mainConfig.Save();
     userConfigs.Save();
 }
Exemplo n.º 2
0
 private void SceneManagerOnActiveSceneChanged(Scene arg0, Scene arg1)
 {
     if (!enabled || safetyEnabled)
     {
         return;
     }
     if (arg1.name == "GameCore")    //Launch calories counter
     {
         Console.WriteLine(modLog + "Scene Loaded succesfully");
         calCounter = null;
         calCounter = new GameObject("inGameCalorieCounter").AddComponent <Igcv02x>();
         Console.WriteLine(modLog + "Calorie counter loaded!");
     }
     if (arg1.name == "Menu")
     {
         if (display != null)
         {
             return;
         }
         display = null;
         display = new GameObject("MenuDisplay").AddComponent <MenuDisplay>();
     }
     return;
 }