/// <summary> /// /// </summary> /// <param name="Damage"></param> private void OnKilledCharacter(FAttackData Damage, EHDamageableComponent DamageComponentWeHit) { if (DamageComponentWeHit.Health <= 0) { CharacterAnim.SetTrigger(ANIM_KILL_CANCEL); } }
/// <summary> /// Retutns the Attack data that is associasted with the animation clip hash /// </summary> /// <param name="AnimationClipHash"></param> /// <returns></returns> public bool GetAttackDataFromAnimationClipHash(int AnimationClipHash, out FAttackData AttackData) { if (!AnimationHashToRowName.ContainsKey(AnimationClipHash)) { Debug.LogWarning("The Animation clip hash that was passed in has not been setup. ANIMATION HASH: " + AnimationClipHash); AttackData = default; return(false); } string AttackDataName = AnimationHashToRowName[AnimationClipHash]; FAttackDataNode AttackNode = DataTableDictioanry[AttackDataName]; AttackData = DataTableDictioanry[AttackDataName].AttackData; return(true); }
private void OnCharacterHit(FAttackData AttackData, EHDamageableComponent DamageableComponent) { Destroy(this.gameObject); }
/// <summary> /// Returns the attack instance of the data table associated with this /// </summary> /// <param name="AttackTable"></param> /// <param name="AttackHash"></param> /// <param name="AttackData"></param> /// <param name="MultiHitIndex"></param> /// <returns></returns> public bool GetAttackDataFromAttackDataTable(AttackDataTable AttackTable, int AttackHash, out FAttackData AttackData) { AttackDataTable InstancedAttackTable = GetAttackDataTable(AttackTable); if (InstancedAttackTable == null) { AttackData = default; return(false); } return(InstancedAttackTable.GetAttackDataFromAnimationClipHash(AttackHash, out AttackData)); }
/// <summary> /// Coroutine that will pause time when an attack is made. This is to give a more satisfying feel to the hit ideally /// </summary> /// <param name="SecondsToPauseGameWhenHitConnected"></param> /// <returns></returns> private IEnumerator StopTimeWhenHitCoroutine(float SecondsToPauseGameWhenHitConnected, EHDamageableComponent DamageComponentThatWeHit, FAttackData AttackData) { float TimeThatHasPassed = 0; while (TimeThatHasPassed < SecondsToPauseGameWhenHitConnected) { TimeThatHasPassed += EHTime.RealDeltaTime; yield return(null); } }