Esempio n. 1
0
    // TODO: Refactor this to be generic for any jump request
    public void GroundedJump()
    {
        RequestingJump = false;
        IsGrounded.SetValue(false);
        body.velocity += Vector2.up * (jumpForce * jumpMultiplier);
        //body.AddForce(Vector2.up * (jumpForce + jumpModifier), ForceMode2D.Impulse);
        RequestingJump = false;
        jumpAudio.PlayRandomSound();

        ChangeState <RaccoonStateInAir>();
    }
Esempio n. 2
0
    void CheckIfAgainstWall()
    {
        Vector2 rayStart          = frontGrip.position;
        bool    againstWallResult = Physics2D.Raycast(rayStart, Vector2.right * direction, surfaceCheckDistance, groundLayer);

        IsAgainstWall.SetValue(againstWallResult || false);

        Debug.DrawRay(rayStart, Vector2.right * direction * surfaceCheckDistance,
                      new Color(0, 1, 0));
    }
 public void OnEnable()
 {
     onTarget.SetValue(false);
 }