Example #1
0
    // Use this for initialization
    void Start()
    {
        master = GameObject.Find ("ControllerManager").GetComponent<ControllerManager> ();
        master.loadLevel (Application.loadedLevelName);

        int numPlayers = master.getNumPlayers ();
        for (int i = 0; i < numPlayers; i++) {
            players[i].SetActive(true);
            score[i].text = "Player " + (i+1) + " Score: " + master.score[i];
            combo[i].text = "Largest Combo: " + master.maxCombo[i];
            missed[i].text = "Missed Notes: " + master.missedNotes[i];
        }
        string victoryType;
        if (master.victoryType == 0) {
            victoryType = " musical mastery!";
        } else {
            victoryType = " blood!";
        }
        victoryText.text = "Player " + (master.victor) + " wins by right of " + victoryType;

        if (master.victor == 0)
            cat.sprite = catWon;
        else if (master.victor == 1)
            dog.sprite = dogWon;
    }
Example #2
0
 void Awake()
 {
     master = GameObject.Find ("ControllerManager").GetComponent<ControllerManager> ();
     master.loadLevel (Application.loadedLevelName);
     int numPlayers = master.getNumPlayers ();
     remaningPlayers = numPlayers;
     for (int i = 0; i < players.Length; i++) {
         players[i].GetComponent<PlayerClass>().loadPlayer(i+1, 0, 50*numPlayers);
         if (i >= numPlayers) {
             players[i].SetActive(false);
         }
     }
 }