Пример #1
0
 void FixedUpdate()
 {
     touchingRight = wallSensorRight.IsWallCollide();
     touchingLeft  = wallSensorLeft.IsWallCollide();
     if (jump)
     {
         //body.AddForce(transform.up * jumpForce, ForceMode2D.Impulse);
         body.velocity = new Vector2(body.velocity.x, jumpSpeed);
         jump          = false;
         StartCoroutine(JumpInterval());
     }
 }
Пример #2
0
 private bool isTouchingWall()
 {
     return(leftWallSensor.IsWallCollide() || rightWallSensor.IsWallCollide());
 }
Пример #3
0
 public bool isOnWall()
 {
     return(wallSensorLeft.IsWallCollide() || wallSensorRight.IsWallCollide());
 }