Esempio n. 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();
            }
        }
Esempio n. 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";
        }
Esempio n. 3
0
 public CompletedState(BasePlayerData player)
 {
     Player = player;
 }
Esempio n. 4
0
 public void GameCompletedState(BasePlayerData player)
 {
     State = new CompletedState(player);
 }