Esempio n. 1
0
 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);
     }
 }
Esempio n. 2
0
    // 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;
        }
    }
Esempio n. 3
0
    // 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();
    }
Esempio n. 4
0
 // Use this for initialization
 void Start()
 {
     pcGO = GameObject.FindObjectOfType <PlayerCountGO> ();
     soundOff.gameObject.SetActive(false);
 }