void Awake(){ powerPrefabs = GetComponent<PowerPrefabs>(); GameObject placementRoot = Instantiate(PlacementUIPrefab, PlacementUIPrefab.transform.position, Quaternion.identity) as GameObject; placementUI = placementRoot.GetComponent<PlacementUI>(); //if starting powers are the same remove the second one and make it undefined before adding to UI if (firstPower == secondPower) { secondPower = PowerType.UNDEFINED; } placementUI.Initialize (powerPrefabs, firstPower, secondPower); }
void Awake(){ if(GameObject.Find("LobbyGUI") != null){ sessionManager = SessionManager.Instance; FindPlatforms(); beginTime = float.PositiveInfinity; playerSpawnVectors = new List<Vector3>(); foreach(Transform location in spawnPositions){ playerSpawnVectors.Add(location.position); } hudTools = GetComponent<HUDTools>(); playersReady = new List<NetworkPlayer>(); allTimedSpawns = new HeapPriorityQueue<PowerSpawn>(30); powerPrefabs = GetComponent<PowerPrefabs>(); GameObject placementRoot = Instantiate(placementRootPrefab, placementRootPrefab.transform.position, Quaternion.identity) as GameObject; placementUI = placementRoot.GetComponent<PlacementUI>(); placementUI.Initialize(powerPrefabs); placementUI.SwitchToLive(false); placementUI.Enable(); } }