private void HandleSteerAndFalling() { Vector3 moveVel = Vector3.zero; if (Input.GetKey(KeyCode.RightArrow)) { moveVel += m_Player.GetSteerRightMovementStep(); m_Player.FaceRightDirection(); } else if (Input.GetKey(KeyCode.LeftArrow)) { moveVel += m_Player.GetSteerLeftMovementStep(); m_Player.FaceLeftDirection(); } else { m_Player.InitSteerMovement(); } //Add fall movement to the steer movement moveVel += m_Player.GetFallMovementStep(); m_Player.transform.localPosition += moveVel * Time.deltaTime; Vector3 pos = m_Player.transform.position; m_FallingCamera.ClampPositionToScreen(ref pos); m_Player.transform.position = pos; m_Player.ResolveCollisions(); }
public void Enter(FallingPlayer player) { m_InputDown = false; m_Player = player; m_Animations.Play("Idle"); m_JumpBoostLeftArrow.gameObject.SetActive(false); m_JumpBoostRightArrow.gameObject.SetActive(false); m_Player.InitFallMovement(); m_Player.InitSteerMovement(); VerticalScrollerUtils.StartScrolling(m_BGScroller, VerticalScrollerUtils.kFallingScrollSpeed); }