예제 #1
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="Damage"></param>
 private void OnKilledCharacter(FAttackData Damage, EHDamageableComponent DamageComponentWeHit)
 {
     if (DamageComponentWeHit.Health <= 0)
     {
         CharacterAnim.SetTrigger(ANIM_KILL_CANCEL);
     }
 }
예제 #2
0
    /// <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);
    }
예제 #3
0
 private void OnCharacterHit(FAttackData AttackData, EHDamageableComponent DamageableComponent)
 {
     Destroy(this.gameObject);
 }
예제 #4
0
    /// <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));
    }
예제 #5
0
    /// <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);
        }
    }