Exemplo n.º 1
0
	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);
	}
Exemplo n.º 2
0
	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();
		} 
	}
Exemplo n.º 3
0
	void Awake(){

		sessionManager = SessionManager.Instance;
		sessionManager.psInfo.LevelReset();
		
		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>();
		timer = GameObject.Find("timer").GetComponent<Timer>();
		timer.Hide();

		ScoreUI scoreUI = placementRoot.GetComponent<ScoreUI>();
		scoreUI.Initialize(sessionManager.psInfo);

		livesUI = placementRoot.GetComponent<LivesUI>();
		livesUI.Initialize(sessionManager.psInfo, sessionManager.psInfo.livesPerRound);

		pointTracker = GetComponent<PointTracker>();
		pointTracker.Initialize(scoreUI);


	}