private void CheckCollisionWithPlayer(Collider collider) { BattlePlayer battlePlayer = collider.gameObject.GetComponentInParent <BattlePlayer>(); if (battlePlayer == null) { return; } if (battlePlayer == Player_) { return; } Vector3 forward = Player_.Rigidbody.velocity; forward = forward.normalized; battlePlayer.Health.TakeDamage(DashDamage, forward, damageSource: Player_); Player_.Health.Knockback(-forward); GameNotifications.OnBattlePlayerDashHit.Invoke(battlePlayer, Player_); dashCollider_.enabled = false; OnDashCancelled.Invoke(); }
private void CheckCollisionWithWall(Collider collider) { Wall wall = collider.gameObject.GetComponentInParent <Wall>(); if (wall == null) { return; } Player_.Health.Knockback(forward: -collider.transform.right); dashCollider_.enabled = false; OnDashCancelled.Invoke(); }