Esempio n. 1
0
        private void Awake()
        {
            if (GameObject.FindGameObjectsWithTag("GAME_HANDLER").Length > 1)
            {
                if (debug)
                {
                    Debug.Log("There is more then one Game Handler. Removing excessive.");
                }
                Destroy(gameObject);
            }
            else
            {
                DontDestroyOnLoad(gameObject);

                GameState.Initiate(startingState);
                InputController.Initiate();
                EnergyHandler.Initiate();
                SoundMechanicHandler.Initiate();
                LevelHandler.Initiate();
                PrefabHolder.Initiate(
                    heatArea,
                    soundElement,
                    energyBullet,
                    energyLaser,
                    energyDetectionVisualization,
                    mainMixer
                    );

                SceneManager.sceneLoaded += CollectLevelProperties;
            }
        }
Esempio n. 2
0
 private void Return()
 {
     LevelHandler.GetPlayer().GetComponent <Player.PlayerController>().EnergyAmount += Energy;
     EnergyHandler.RemoveEnergyObject(this);
     Debug.Log("Returning Energy to player");
     Destroy(gameObject);
 }
Esempio n. 3
0
 public void UpdateField()
 {
     ResizeArea();
     UpdateParticleSystem();
     if (Energy <= 0)
     {
         EnergyHandler.RemoveEnergyObject(this);
         Destroy(gameObject);
     }
 }
Esempio n. 4
0
 public static void Initiate()
 {
     instance = new EnergyHandler();
 }