예제 #1
0
 void Start()
 {
     activePlayerList = GameObject.Find("_PlayerData_").GetComponent <ActivePlayerList>();
     for (int i = 0; i < 4; i++)
     {
         InfoCards[i].gameObject.SetActive(false);
         if (i < playerAmount && activePlayerList.Players[i].isAlive == true)
         {
             InfoCards[i].gameObject.SetActive(true);
         }
     }
     players = new PlayerController[playerAmount];
     for (int i = 0; i < playerAmount; i++)
     {
         if (activePlayerList.Players[i].isAlive)
         {
             PlayerController player = GameObject.Instantiate(playerTemplate, this.transform.parent, false) as PlayerController;
             player.playerId   = i;
             players[i]        = player;
             player.weaponId   = activePlayerList.Players[i].Weapon;
             player.playerName = activePlayerList.Players[i].rePlayerID;
             if (activePlayerList.Players[i].isBot)
             {
                 player.gameObject.AddComponent <NaIA>();
                 player.isBot = true;
             }
         }
     }
     playerTemplate.gameObject.SetActive(false);
     finished = false;
 }
예제 #2
0
 // Use this for initialization
 void Start()
 {
     activePlayerList = GameObject.Find("_PlayerData_").GetComponent <ActivePlayerList>();
     rePlayerList     = ReInput.players.AllPlayers;
     for (int i = 0; i < 4; i++)
     {
         var player = activePlayerList.Players[i];
         player.isAlive    = true;
         player.Score      = 0;
         player.Id         = i;
         player.rePlayerID = string.Format("Bot {0}", i);
     }
 }
 // Use this for initialization
 void Start()
 {
     activePlayerList = GameObject.Find("_PlayerData_").GetComponent <ActivePlayerList>();
     if (commandController)
     {
         for (int i = 0; i < 4; i++)
         {
             Player p = activePlayerList.Players[i];
             PlayerGOs[i].GetComponentInChildren <GrindPlayerCtrl>().player = p;
             if (!p.isAlive)
             {
                 PlayerGOs[i].SetActive(false);
             }
             Players[i] = p;
             commandController.Players[i] = p;
         }
     }
 }