// Use this for initialization void Awake() { myUniqueController = (GameController)GameObject.FindObjectOfType(typeof(GameController)); if (myUniqueController == null) { Debug.LogError("NULL myUniqueController!"); } // Start the music myMusicController = (GameMusicController)GameObject.FindObjectOfType(typeof(GameMusicController)); if (myMusicController == null) { Debug.LogError("NULL myMusicController!"); } }
private void Awake() { if (_instance != null && _instance != this) { Destroy(gameObject); return; } else { _instance = this; } instance = _instance; DontDestroyOnLoad(this); }
// Use this for early initialization void Awake() { mySoundButton = GameObject.FindGameObjectWithTag("SoundOnOffButton"); if (mySoundButton == null) { Debug.LogError("SOUND BUTTON NULL"); } myMusicButton = GameObject.FindGameObjectWithTag("MusicOnOffButton"); if (myMusicButton == null) { Debug.LogError("MUSIC BUTTON NULL"); } myTutorialButton = GameObject.FindGameObjectWithTag("TutorialOnOffButton"); if (myTutorialButton == null) { Debug.LogError("TUTORIAL BUTTON NULL"); } myDifficultyButton = GameObject.FindGameObjectWithTag("myDifficultyButton"); if (myDifficultyButton == null) { Debug.LogError("DIFFICULTY BUTTON NULL"); } myUniqueController = (GameController)GameObject.FindObjectOfType(typeof(GameController)); if (myUniqueController == null) { Debug.LogError("NULL myUniqueController!"); } // Use this for initialization myMusicController = (GameMusicController)GameObject.FindObjectOfType(typeof(GameMusicController)); if (myMusicController == null) { Debug.LogError("NULL myMusicController!"); } // Set application version myGameVersion = Utils.GetTextWithName("TheGameVersion"); myGameVersion.text = "Bottle Trap v" + Application.version; }
void Awake() { myUniqueController = (GameController)GameObject.FindObjectOfType(typeof(GameController)); if (myUniqueController == null) { Debug.LogError("NULL myUniqueController!"); } // Start the music myMusicController = (GameMusicController)GameObject.FindObjectOfType(typeof(GameMusicController)); if (myMusicController == null) { Debug.LogError("NULL myMusicController!"); } // Initialize scoreText = Utils.GetTextWithName("ScoreValueText"); timeText = Utils.GetTextWithName("TimeValueText"); levelText = Utils.GetTextWithName("LevelValueText"); }