public static void ApplyAbilityPerformedOnHitEntity(AbilityCastData castData, Entity entity, AbilityCastResult existingResult = null) { AbilityCastResult result = existingResult == null ? new AbilityCastResult(castData) : existingResult; result.FillVictim(entity); if (result.ImpactFilled == false) { result.FillImpact(ComputePerformedAbilityImpact(castData, entity)); } entity.ReceiveAbilityHit(result); }
private void ApplyHitOnEntity(Entity ent, AbilityPerformer.AdditionalHitInfos infos) { AbilityCastResult result = null; if (infos != null) { result = new AbilityCastResult(_castData); Vector3 impact = infos.Hit.point; if (impact.sqrMagnitude <= Mathf.Epsilon) { impact = infos.RayOrigin; } result.FillImpact(impact); } AbilityPerformer.ApplyAbilityPerformedOnHitEntity(_castData, ent, result); HandleCheckHitboxLife(); }