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