private void PlayerSetUp(GameObject playerGameObject, int playerNo) { group.AddMember(playerGameObject.transform, 1, 0); Player player = playerGameObject.GetComponent <Player>(); player.SetPlayerNo(playerNo); player.SetSkin(playerNo); players.Add(player); // Adding skills to players AddBasicSkills(player); if (playerNo == 1) { player.AddSkill(selectedSkills[SkillSelectionController.GetPlayerOneSkill()]); playerOneCooldownUi.player = player.GetComponent <Player>(); var playerOneChargeControllers = playerOneCooldownUi.GetComponentsInChildren <ChargeController>(); SetCharge(player, playerOneChargeControllers); playerOneHealthBar.entity = player.GetComponent <IHealthBar>(); } else { player.AddSkill(selectedSkills[SkillSelectionController.GetPlayerTwoSkill()]); playerTwoCooldownUi.player = player.GetComponent <Player>(); var playerTwoChargeControllers = playerTwoCooldownUi.GetComponentsInChildren <ChargeController>(); SetCharge(player, playerTwoChargeControllers); playerTwoHealthBar.entity = player.GetComponent <IHealthBar>(); } }