public override void Attack(GameUnit targetUnit) { if (CanDoSpecialAbility()) { if (SpecialCombatAbility.HasUnit) { CombatAbilityUnit abilityUnit = Instantiate(SpecialCombatAbility.AbilityPrefab); abilityUnit.Begin(behaviourOwner); //abilityUnit.BeginWithMovement(behaviourOwner.AttackSource.transform.position, targetUnit.HitTarget.position, behaviourOwner); } RestartSpecialAbilityCooldown(); } else { if (!BasicCombatAbility.HasUnit) { targetUnit.Hit(BasicCombatAbility.Stats.CurrentStatsLevel.Damage); } else { CombatAbilityUnit abilityUnit = Instantiate(BasicCombatAbility.AbilityPrefab); abilityUnit.BeginWithMovement(behaviourOwner.AttackSource.transform.position, targetUnit.HitTarget.position, behaviourOwner); } } }
private void Hit(GameUnit target) { if (RuntimeBehaviour.Stats.Modifier != null) { target.Hit(RuntimeBehaviour.Stats.CurrentStatsLevel.Damage, RuntimeBehaviour.Stats.Modifier); } else { target.Hit(RuntimeBehaviour.Stats.CurrentStatsLevel.Damage); } RuntimeBehaviour.OnHit(); if (HitEffect != null) { HitEffect.transform.SetParent(null, true); HitEffect.SetActive(true); } }