예제 #1
0
        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();
            }
        }
예제 #2
0
        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";
        }
예제 #3
0
 public CompletedState(BasePlayerData player)
 {
     Player = player;
 }
예제 #4
0
 public void GameCompletedState(BasePlayerData player)
 {
     State = new CompletedState(player);
 }