private void Player_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) { if (e.PropertyName == nameof(BasePlayerData.Point)) { BasePlayerData player = sender as BasePlayerData; int index = Players.IndexOf(player); int point = int.Parse(UIPlayers[index].Point.text); UIPlayers[index].Point.text = (point + player.Point).ToString(); } }
public void AddPlayer(BasePlayerData player) { Players.Add(player); player.PropertyChanged += Player_PropertyChanged; UIPlayers[Players.Count - 1].PlayerName.gameObject.SetActive(true); UIPlayers[Players.Count - 1].PlayerName.text = player.Name; UIPlayers[Players.Count - 1].Point.gameObject.SetActive(true); UIPlayers[Players.Count - 1].Point.text = "0"; }
public CompletedState(BasePlayerData player) { Player = player; }
public void GameCompletedState(BasePlayerData player) { State = new CompletedState(player); }