void Start() { // Hide menu menu.SetActive(false); // ** Create architect player ** // GameObject newArchitect = GameObject.Instantiate(ArchitectPrefab, architectSpawnLocation.transform.position, Quaternion.identity) as GameObject; ArchitectPawn = newArchitect.GetComponent <ArchitectPawn>(); // ** Create builder players ** // bool[] connectedControllers = MP_Input.GetConnectedControllers(); for (int i = 0; i < connectedControllers.Length; i++) { if (connectedControllers[i]) { MP_InputDeviceInfo device = new MP_InputDeviceInfo(MP_eInputType.Controller, i); GameObject newBuilder = GameObject.Instantiate(BuilderPrefab, builderSpawnLocations[i].transform.position, Quaternion.identity) as GameObject; BuilderPawn newBuilderPawn = newBuilder.GetComponent <BuilderPawn>(); if (newBuilderPawn != null) { newBuilder.GetComponent <BuilderHealth>().onPlayerDeath += CheckIfAllPlayerDead; newBuilderPawn.Initialize(device); BuilderPawns.Add(newBuilderPawn); } } } }
public void Initialize(ArchitectPawn aPawn) { pawn = aPawn; }