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; } }
public static void PlayVisualSound(Vector3 origin, float loudness) { GameObject s = GameObject.Instantiate(PrefabHolder.SoundElement(), origin, Quaternion.identity); SoundElement sE = s.GetComponent <SoundElement>(); sE.Setup(loudness); }
public static EnergyArea CreateEnergyArea(Vector3 position) { GameObject go = GameObject.Instantiate(PrefabHolder.EnergyArea(), position, Quaternion.identity); EnergyArea ha = go.GetComponent <EnergyArea>(); AddEnergyObject(ha); return(ha); }
public static void Initiate(GameObject _heatArea, GameObject _soundElement, GameObject _energyBullet, GameObject _energyLaser, GameObject _energyDetectionVisualizer, AudioMixer _mainMixer) { instance = new PrefabHolder(_heatArea, _soundElement, _energyBullet, _energyLaser, _energyDetectionVisualizer, _mainMixer); }