public void Init(long playerId, GameObject playerScoreObject, string score, PlayerScoreEvents.ParticleType particleType, Color xpTintColor) { this.playerId = playerId; this.playerScoreObject = playerScoreObject; this.score = score; this.particleType = particleType; this.xpTintColor = xpTintColor; ScoreText.text = ""; ScoreTextShadow.text = ""; }
private void addToPlayerScoresDictionary(long playerId, GameObject playerScoreObject, string score, PlayerScoreEvents.ParticleType particleType, Color xpTintColor) { List <GameObject> value; if (!playerScoresDictionary.ContainsKey(playerId)) { value = new List <GameObject>(); playerScoresDictionary.Add(playerId, value); } if (playerScoresDictionary.TryGetValue(playerId, out value)) { value.Add(playerScoreObject); playerScoreObject.transform.SetParent(base.transform, worldPositionStays: false); playerScoreObject.GetComponentsInChildren <PlayerScoreComponent>()[0].Init(playerId, playerScoreObject, score, particleType, xpTintColor); } }
private void onPlayerScorePrefabLoaded(GameObject prefab, long playerId, string score, PlayerScoreEvents.ParticleType particleType, Color xpTintColor) { GameObject playerScoreObject = Object.Instantiate(prefab); addToPlayerScoresDictionary(playerId, playerScoreObject, score, particleType, xpTintColor); }