private void StartClimbing(Object_Ladder a_rLadder) { m_bQuitByJumping = false; m_bClimbing = true; m_rLadder = a_rLadder; Position = m_rLadder.SnapOnLadder(Position, climberTop.position, climberBottom.position); movementController.DisableMovement(); if (onStartClimb != null) { onStartClimb(); } }
private void Climb(float a_fClimb) { float fClimbHeightPrevious = Position.y; bool bReachTheTop; bool bReachTheBottom; Position = m_rLadder.SnapOnLadder(Position + m_rLadder.LadderUpDirection * a_fClimb, climberTop.position, climberBottom.position, out bReachTheTop, out bReachTheBottom); float fClimbHeightNext = Position.y; if (onClimb != null) { onClimb(fClimbHeightNext - fClimbHeightPrevious); } if (m_rLadder.canGoOnTop && characterInput.Vertical > 0.0f && bReachTheTop) { PutOnTop(); } else if (m_rLadder.canGoOnBottom && characterInput.Vertical < 0.0f && bReachTheBottom) { PutOnBottom(); } }
private void StartClimbing(Object_Ladder a_rLadder) { m_bQuitByJumping = false; m_bClimbing = true; m_rLadder = a_rLadder; Position = m_rLadder.SnapOnLadder(Position, climberTop.position, climberBottom.position); movementController.DisableMovement(); if(onStartClimb != null) { onStartClimb(); } }