void Start() { NetworkManager.singleton.GetComponent <MatchTimer>().enabled = true; OverlayActive.SetOverlayActive(false); //PauseMenu.isOn = false; #if !UNITY_ANDROID joystick.SetActive(false); pauseButton.SetActive(false); scoreboardButton.SetActive(false); #else joystick.SetActive(true); pauseButton.SetActive(true); scoreboardButton.SetActive(true); #endif }
// Use this for initialization void Start () { player = NetworkManager.singleton.playerPrefab; OverlayActive.SetOverlayActive(true); // Stop rendering stuff //player.GetComponent<Renderer>().enabled = false; //GameObject.Find("skydome").SetActive(false); //GameObject.Find("MapGenerator").SetActive(false); //GameObject.Find("Terrain").SetActive(false); //GameObject.Find("WorldSpawner").SetActive(false); //GameObject.Find("HealthBarManager").SetActive(false); // Set winner/loser text playersGO = GameObject.FindGameObjectsWithTag("Player"); if (playersGO.Length > 1) { for (int i = 0; i < playersGO.Length - 1; ++i) { if (playersGO[i].GetComponent<Player>().GetKills() > playersGO[i + 1].GetComponent<Player>().GetKills()) matchWinner = playersGO[i]; else if (playersGO[i].GetComponent<Player>().GetKills() < playersGO[i + 1].GetComponent<Player>().GetKills()) matchWinner = playersGO[i + 1]; else matchWinner = null; } } else { matchWinner = player; } if (matchWinner == player) matchWinnerText.text = "Winner"; else if (matchWinner != null) matchWinnerText.text = "Loser"; else matchWinnerText.text = "Neutral"; }
public void SetInactive() { OverlayActive.SetOverlayActive(false); }
public void SetActive() { OverlayActive.SetOverlayActive(true); }
public void ToggleRespawnScreen() { respawnScreen.SetActive(!respawnScreen.activeSelf); OverlayActive.SetOverlayActive(!OverlayActive.IsOverlayActive()); }
public void TogglePauseMenu() { pauseMenu.SetActive(!pauseMenu.activeSelf); OverlayActive.SetOverlayActive(!OverlayActive.IsOverlayActive()); //PauseMenu.isOn = pauseMenu.activeSelf; }