Ejemplo n.º 1
0
    void Start()
    {
        if (!started)
        {
            if (GameObject.Find("MatchInfo") != null)                   //If the match was set by a former screen, set this match to that type
            {
                MultiSceneMessenger msm = GameObject.Find("MatchInfo").GetComponent <MultiSceneMessenger> ();
                type = msm.matchType;
                //				if (type == GameType.online)
                //					onlineMatch = msm.onlineMatch;
            }

            Moves    = new Move[2];
            Turn     = 0;
            Fighters = new Character[2];

            if (type == GameType.local)
            {
                playerNames = new string[] { "Player 1", "Player 2" };
                Fighters[0] = new KyoryuCharacter(3);
                Fighters[1] = new KyoryuCharacter(7);
            }
            else if (type == GameType.ai)
            {
                playerNames = new string[] { "Player 1", "Computer" };
                Fighters[0] = new KyoryuCharacter(3);
                Fighters[1] = new AIPlayer(5, new KyoryuCharacter(7));
            }
//			else if (type == GameType.online) {
//				playerNames = new string[]{onlineMatch.Participants[0].DisplayName, onlineMatch.Participants[1].DisplayName};
//				int myId = 0;
//				int theirId = 1;
//				if( onlineMatch.SelfParticipantId != "p_1") {
//					 myId = 1;
//					 theirId = 0;
//				}
//				Fighters[myId] = new KyoryuCharacter(7);
////				Fighters[theirId] = ;
//			}
        }

        BetweenTurnPopup.SetActive(false);

        characterGUI [0].SetPlayerMaxHealth(Fighters [0].GetHealth());
        characterGUI [1].SetPlayerMaxHealth(Fighters [1].GetHealth());

        characterGUI [0].SetPlayerName(playerNames [0]);
        characterGUI [1].SetPlayerName(playerNames [1]);

        SetupGUI();
    }
Ejemplo n.º 2
0
 void Start()
 {
     matchInfo = GameObject.Find("MatchInfo").GetComponent <MultiSceneMessenger>();
 }