private void SetUnitTeam(BattleUnitTeamType team)
 {
     if (team == BattleUnitTeamType.Ally)
     {
         Behaviour = _container.InstantiateComponent <BattleUnitAlly>(gameObject);
     }
     else if (team == BattleUnitTeamType.Enemy)
     {
         Behaviour = _container.InstantiateComponent <BattleUnitEnemy>(gameObject);
     }
 }
        private void SetCellBg(BattleUnitTeamType team)
        {
            if (team == BattleUnitTeamType.Ally)
            {
                GetComponent <Image>().color = allyColor;
            }

            if (team == BattleUnitTeamType.Enemy)
            {
                GetComponent <Image>().color = enemyColor;
            }
        }
Exemple #3
0
        public void SubscribeCellToList(BattleUnitTeamType team, BattleCellView cell)
        {
            switch (team)
            {
            case BattleUnitTeamType.Ally:
                _allyUnits.Add(cell);
                break;

            case BattleUnitTeamType.Enemy:
                _enemyUnits.Add(cell);
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(team), team, null);
            }
        }