TopDown Engine v4.5
Loading...
Searching...
No Matches
MoreMountains.TopDownEngine.AIActionSwapBrain Class Reference

This simple action lets you swap the brain of an AI at runtime, for a new brain, specified in the inspector. More...

Inheritance diagram for MoreMountains.TopDownEngine.AIActionSwapBrain:
MoreMountains.Tools.AIAction

Public Member Functions

override void Initialization ()
 On init, we grab and store our Character.
override void PerformAction ()
 On PerformAction we swap our brain.
Public Member Functions inherited from MoreMountains.Tools.AIAction
void PerformAction ()
virtual void OnEnterState ()
 Describes what happens when the brain enters the state this action is in. Meant to be overridden.
virtual void OnExitState ()
 Describes what happens when the brain exits the state this action is in. Meant to be overridden.

Public Attributes

AIBrain NewAIBrain
 the brain to replace the Character's one with
Public Attributes inherited from MoreMountains.Tools.AIAction
InitializationModes InitializationMode
 whether initialization should happen only once, or every time the brain is reset
string Label
 a label you can set to organize your AI Actions, not used by anything else

Protected Member Functions

virtual void SwapBrain ()
 Disables the old brain, swaps it with a new one and enables it.
Protected Member Functions inherited from MoreMountains.Tools.AIAction
virtual void Awake ()
 On Awake we grab our AIBrain.

Protected Attributes

Character _character
Protected Attributes inherited from MoreMountains.Tools.AIAction
bool _initialized
AIBrain _brain

Additional Inherited Members

Public Types inherited from MoreMountains.Tools.AIAction
enum  InitializationModes { EveryTime , OnlyOnce }
Properties inherited from MoreMountains.Tools.AIAction
virtual bool ActionInProgress [get, set]
virtual bool ShouldInitialize [get]

Detailed Description

This simple action lets you swap the brain of an AI at runtime, for a new brain, specified in the inspector.

Member Function Documentation

◆ Initialization()

override void MoreMountains.TopDownEngine.AIActionSwapBrain.Initialization ( )
virtual

On init, we grab and store our Character.

Reimplemented from MoreMountains.Tools.AIAction.

◆ PerformAction()

override void MoreMountains.TopDownEngine.AIActionSwapBrain.PerformAction ( )

On PerformAction we swap our brain.

◆ SwapBrain()

virtual void MoreMountains.TopDownEngine.AIActionSwapBrain.SwapBrain ( )
protectedvirtual

Disables the old brain, swaps it with a new one and enables it.

Member Data Documentation

◆ _character

Character MoreMountains.TopDownEngine.AIActionSwapBrain._character
protected

◆ NewAIBrain

AIBrain MoreMountains.TopDownEngine.AIActionSwapBrain.NewAIBrain

the brain to replace the Character's one with


The documentation for this class was generated from the following file:
  • H:/Code/MoreMountains/topdownengine/Assets/TopDownEngine/Common/Scripts/Characters/AI/Advanced/AIActionSwapBrain.cs