void Awake() { //Prevents another instance of this script to come to existence by switching scenes if (instance != null) { Destroy(gameObject); } else { instance = this; GameObject.DontDestroyOnLoad(gameObject); } }
// Use this for initialization void Start() { pcGO = GameObject.FindObjectOfType <PlayerCountGO> (); SelectNumberOfPlayers(playerCount); SetPlayerColorsArray(); //un-highlights all images except the first one (single player standard) for (int i = 1; i < playerImages.Length; i++) { Color tmp = playerImages [i].color; tmp.a = 0.2f; playerImages [i].color = tmp; } }
// Use this for initialization void Start() { pinSetter = GameObject.FindObjectOfType <PinSetter> (); scoreDisplay = GameObject.FindObjectOfType <ScoreDisplay> (); pcGO = GameObject.FindObjectOfType <PlayerCountGO> (); levelManager = GameObject.FindObjectOfType <LevelManager> (); try{ players = pcGO.GetPlayerCount(); }catch { Debug.LogWarning("WARNING: no PlayerCountGO found. Did you start from menu?"); } CreatePlayers(); }
// Use this for initialization void Start() { pcGO = GameObject.FindObjectOfType <PlayerCountGO> (); soundOff.gameObject.SetActive(false); }