void BindPlayerUI(PlayerSelectionData data, int playerCounter, GameObject player) { string panelContainerString = data.ArenId == 0 ? "Arena1PlayerPanels" : "Arena2PlayerPanels"; GameObject Panel = GameObject.Find(panelContainerString).transform.GetChild(playerCounter).gameObject; Panel.SetActive(true); Panel.GetComponentInChildren <PlayerUIController>().Initialize(player, data.Name, "Frank"); }
// Start is called before the first frame update void Start() { playerSelectionObject = GameObject.Find("PlayerSelectionData").GetComponent <PlayerSelectionData>(); raycaster = GetComponent <GraphicRaycaster>(); eventSystem = GetComponent <EventSystem>(); ChoosePlayerSelector.OnSelectionChanged += OnPlayerSelectionChanged; }
void Start() { gameData = GameObject.Find("GameData").GetComponent <GameData>(); statsScript = GameObject.Find("StatsObject").GetComponent <StatsScript>(); // This will only find the currently active spawn points playerSpawnPoints = new List <GameObject>(GameObject.FindGameObjectsWithTag("Player spawnpoint")); GameObject selectiomDataObj = GameObject.Find("PlayerSelectionData"); if (selectiomDataObj != null) { playerSelectionData = selectiomDataObj.GetComponent <PlayerSelectionData>(); SpawnPlayers(); } else { SpawnPlayersForKeyboardAndMouseControl(); } }
public void Start() { playerSelectionData = GameObject.Find("PlayerSelectionData").GetComponent <PlayerSelectionData>(); }
// Temporary this data will come from the player selection menu void SetPlayerData() { PlayerSelectionData = new PlayerSelectionData[2]; PlayerSelectionData[0] = new PlayerSelectionData(0, "Player1", 1, 0); PlayerSelectionData[1] = new PlayerSelectionData(1, "Player2", 2, 1); }