private void InitComboCounterSubComponent() { if (m_PlayerComboCounterSC == null && m_RegisteredPlayer != null) { PlayerAttackComponent playerAttackComponent = m_RegisteredPlayer.GetComponent <PlayerAttackComponent>(); if (playerAttackComponent != null) { m_PlayerComboCounterSC = playerAttackComponent.GetComboCounterSubComponent(); m_PlayerComboCounterSC.OnHitCounterChanged += OnHitCounterChanged; } } }
protected float GetDamageRatio() { if (!m_DamageRatioComputed) { PlayerComboCounterSubComponent comboSC = m_AttackComponent.GetComboCounterSubComponent(); if (comboSC != null) { uint hitCounter = comboSC.GetComboCounter(); m_DamageRatio = AttackConfig.Instance.m_DamageScaling.Evaluate(hitCounter); m_DamageRatio = Mathf.Clamp(m_DamageRatio, 0f, 1f); m_DamageRatioComputed = true; } } return(m_DamageRatio); }