Description
The OnModeEnd
method is a virtual method in the MoveMode
class, which is part of the Sandbox.Movement
namespace. This method is called when the current movement mode ends, and it transitions to another movement mode. It is intended to be overridden in derived classes to provide specific behavior when a movement mode ends.
Usage
To use the OnModeEnd
method, you should create a class that derives from MoveMode
and override this method to implement custom logic that should occur when the movement mode ends. The method takes a single parameter, next
, which is the next MoveMode
that the system will transition to.
Example
public class CustomMoveMode : MoveMode
{
public override void OnModeEnd(MoveMode next)
{
// Custom logic to execute when this move mode ends
// For example, clean up resources or reset variables
// Call base method if needed
base.OnModeEnd(next);
}
}