void BounceToLocation() { if (controller.Collisions.isRight || controller.Collisions.isLeft) { gameObject.SetActive(false); } controller.ApplyGravity(ref direction); if (controller.Collisions.isBelow) { controller.Bounce(); } controller.ApplyMovement(direction); }
public void CheckEnemyHit(RaycastHit2D hit) { if (hit.transform.tag == "VulnerablePoint") { SoundManager.instance.PlaySingle(stompSound); Enemy enemy = hit.transform.parent.GetComponent <Enemy>(); enemy.OnPlayerStomp(); controller.Bounce(); } else if (hit.transform.tag == "Enemy") { LevelManager.instance.OnPlayerKilled(); } }