Exemple #1
0
    private void TriggerHitFX(PlayerBaseAttackLogic attackLogic, Vector3 hitPoint, EAttackResult attackResult, EHitNotificationType hitNotificationType)
    {
        Profiler.BeginSample("PlayerHealthComponent.TriggerHitFX");

        m_HitFXTypeList.Clear();
        attackLogic.GetHitFX(attackResult, hitNotificationType, ref m_HitFXTypeList);
        if (m_HitFXTypeList.Count > 0)
        {
            bool       flipHitFX;
            Collider2D lastHitCollider = attackLogic.GetLastHitCollider();
            if (lastHitCollider != null)
            {
                Transform hitOwner = lastHitCollider.transform.root;
                flipHitFX = hitOwner.position.x < transform.position.x;
            }
            else
            {
                flipHitFX = attackLogic.GetOwner().transform.position.x < transform.position.x;
            }

            int playerIndex = m_InfoComponent.GetPlayerIndex();
            for (int i = 0; i < m_HitFXTypeList.Count; i++)
            {
                m_FXManager.SpawnHitFX(playerIndex, m_HitFXTypeList[i], hitPoint, Quaternion.identity, flipHitFX);
            }
        }

        Profiler.EndSample();
    }
Exemple #2
0
 public void SpawnHitFX(EHitFXType hitFXType)
 {
     m_FXManager.SpawnHitFX(m_PlayerInfoComponent.GetPlayerIndex(), hitFXType, m_FXHook.position, m_FXHook.localRotation, m_FXHook.lossyScale.x < 0);
 }