IEnumerator Start() { #if UNITY_EDITOR if (UnityEditor.EditorApplication.isPlaying) #endif { if (ShallowGames.ContainsScore(playerID)) { color = PlayerManager.Instance.GetColor(playerID); SetScore(ShallowGames.GetPlayerScore(playerID).PrevScore); yield return(new WaitForSeconds(1.0f)); SetScore(ShallowGames.GetPlayerScore(playerID).RoundScore); } else { gameObject.SetActive(false); } } }
void Start() { playerText.text = string.Format("Player {0}", playerID + 1); PlayerManager.inputAdded.AddListener(PlayerAdded); PlayerManager.inputRemoved.AddListener(PlayerRemoved); ShallowGames.scoreUpdated.AddListener(ScoreUpdated); #if UNITY_EDITOR if (UnityEditor.EditorApplication.isPlaying) #endif { color = PlayerManager.Instance.GetColor(playerID); if (PlayerManager.Contains(playerID)) { if (Lobby.Instance != null) { PlayerScore playerScore = ShallowGames.GetPlayerScore(playerID); ScoreUpdated(new PlayerScoreUpdate(playerID, playerScore.Score, playerScore.Score)); } notJoinedParent.SetActive(false); joinedParent.SetActive(true); } else { if (Lobby.Instance == null) { notJoinedParent.SetActive(false); joinedParent.SetActive(false); } else { notJoinedParent.SetActive(true); joinedParent.SetActive(false); } } } }