public void OnGUI() { if (currentMobCount <= 0 && waveStartTimeRemaining > 0) { GUI.Label(new Rect(25, 25, 200, 50), "Wave " + currentWaveNumber.ToString() + " Completed. Next wave in: " + waveStartTimeRemaining.ToString()); } if (playerShipInstance = null) { GUI.Label(new Rect(25, 25, 50, 50), "GAME OVAR!!"); } }
public void ResetGame() { if (XSize < 5) XSize = 5; if (YSize < 5) YSize = 5; levelBounds.SetMinMax(new Vector3((-XSize / 2) - 1, -1, -(YSize / 2) - 1), new Vector3(1 + XSize / 2, 1, 1 + YSize / 2)); Vector3 newPosition = new Vector3(0,0,0); Vector3 newScale = new Vector3(1,1,1); newPosition.z = (YSize + 2) / 2; newScale.x = XSize + 1; NorthWall.position = new Vector3(0,0,(YSize + 2) / 2); NorthWall.localScale = new Vector3(XSize + 1, 1, 1); SouthWall.position = new Vector3(0,0,-(YSize + 2) / 2); SouthWall.localScale = new Vector3(XSize + 1, 1, 1); EastWall.position = new Vector3((XSize + 2) / 2, 0, 0); EastWall.localScale = new Vector3(1, 1, YSize + 3); WestWall.position = new Vector3(-(XSize + 2) / 2, 0, 0); WestWall.localScale = new Vector3(1, 1, YSize + 3); spilloverSpawnPoints = 0; playerScore = 0; currentWaveNumber = 0; for (int i = 0; i < allMobPrefabs.Length; i++) { allMobPrefabs[i].ResetLevel(); } playerShipInstance = (PlayerShipCS) Instantiate(prefabPlayerShip, new Vector3(0,0,0), Quaternion.identity); }