Description
The OnModeEnd
method is a virtual method in the MoveModeSwim
class, which is part of the Sandbox.Movement
namespace. This method is called when the swimming mode ends, transitioning to another movement mode. It allows for any necessary cleanup or state changes when the swimming mode is exited.
Usage
Override this method in a derived class to implement custom behavior when the swimming mode ends. This method receives a parameter of type MoveMode
, which represents the next movement mode the character will transition into.
Example
public class CustomSwimMode : MoveModeSwim
{
public override void OnModeEnd(MoveMode next)
{
// Custom logic when swimming mode ends
// For example, reset swim-related variables or log the transition
base.OnModeEnd(next);
}
}