public override bool HandleFixedUpdate() { //TODO; this is such a hack if (InputManager.Instance.IgnoreInput) { return(true); } if (!f_controller.Grounded) { return(true); } if (f_controller.Backwards) { f_controller.Backwards = false; } if (Mathf.Abs(f_controller.Velocity.x) < 0.1f) { f_controller.GroundMovement.MovingRight = !f_controller.GroundMovement.MovingRight; } f_controller.Velocity = Vector2.zero; GroundTouch gt = f_controller.GroundMovement.Move((f_controller.GroundMovement.MovingRight ? 1 : -1) * SPEED * BossFightRhino.SPEED); if (m_stopAtEdges) { int airDirection = GroundMovementRaycast.AirDirection(gt); if (airDirection < 0) { f_controller.GroundMovement.MovingRight = true; } else if (airDirection > 0) { f_controller.GroundMovement.MovingRight = false; } } return(true); }
public override bool HandleFixedUpdate() { //TODO; this is such a hack if (InputManager.Instance.IgnoreInput) { return(true); } if (!f_controller.Grounded) { return(true); } if (m_cooldown == -1) { if (f_controller.Backwards) { f_controller.Backwards = false; // if (f_controller.Velocity.x != 0) { // m_walkingRight = // } } if (Mathf.Abs(f_controller.Velocity.x) < 0.1f) { Cancel(); } //TODO; does not care about transform if (f_controller.Velocity.x < -0.1f) { f_controller.GroundMovement.MovingRight = false; } else if (f_controller.Velocity.x > 0.1f) { f_controller.GroundMovement.MovingRight = true; } f_controller.Velocity = Vector2.zero; GroundTouch gt = f_controller.GroundMovement.Move((f_controller.GroundMovement.MovingRight ? 1 : -1) * CHARGE_SPEED * BossFightRhino.SPEED); if (m_stopAtEdges) { int airDirection = GroundMovementRaycast.AirDirection(gt); if (airDirection != 0) { Cancel(); } } } else { if (m_cooldown == CHARGE_COOLTIME) { f_futureStates = m_futureStatesHelper; m_cooldown = -1; } ++m_cooldown; } return(true); }