Skip to content

OnAIBrainStateSwitch

Usage

  • Return a bool value to override default behavior

Example Autogenerated

csharp
private bool? OnAIBrainStateSwitch( BaseAIBrain instance, BaseAIBrain.BasicAIState CurrentState, BaseAIBrain.BasicAIState newState )
{
    Puts( "OnAIBrainStateSwitch works!" );
    return null;
}

Location

  • BaseAIBrain::SwitchToState(BaseAIBrain.BasicAIState newState, int stateContainerID)
csharp
//---
		}
		if (CurrentState == newState && !UseAIDesign)
		{
			return false;
		}
		object obj = Interface.CallHook("OnAIBrainStateSwitch", this, CurrentState, newState);
		if (obj != null)
		{
			if (!(obj is bool))
			{
				return false;
//---

Released under the MIT License.