public void PlayerUnitAttack(int PlayerAttackingUnit, int _TargetAttackedUnit, SpellTarget TargetPlayerOrIA, string SpellID) { Unit _PlayerUnitGameObject; switch (TargetPlayerOrIA) { case SpellTarget.IAUNIT: PlayerUnitCrew.TryGetValue(PlayerAttackingUnit, out _PlayerUnitGameObject); UnitBattle _PlayerUnitBattle = _PlayerUnitGameObject.InstantiatedUnit.GetComponent <UnitBattle>(); _PlayerUnitBattle.PlayerSpellAttack(SpellID, _TargetAttackedUnit, PlayerAttackingUnit); break; case SpellTarget.ALLY: case SpellTarget.SELF: default: PlayerUnitCrew.TryGetValue(PlayerAttackingUnit, out _PlayerUnitGameObject); UnitBattle _PlayerUnitBattleBuff = _PlayerUnitGameObject.InstantiatedUnit.GetComponent <UnitBattle>(); _PlayerUnitBattleBuff.PlayerSpellBuff(SpellID, _TargetAttackedUnit, PlayerAttackingUnit); break; } }