Пример #1
0
    public void SendTarget(Unit unit)
    {
        List <Unit> targets = new List <Unit>();

        if (skill.CastOnAll)
        {
            if (unit.GetType() == typeof(EnemyUnit))
            {
                foreach (EnemyTarget et in enemyTargets)
                {
                    targets.Add(et.UnitParent);
                }
            }
            else
            {
                foreach (PlayerTarget pt in playerTargets)
                {
                    targets.Add(pt.UnitParent);
                }
            }
        }
        else
        {
            targets.Add(unit);
        }

        skill.SetTargets(targets);
        EndTargetting();
        skill.Invoke();
    }