コード例 #1
0
    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);
    }
コード例 #2
0
    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();
        }
    }