Brain

Merlins Beard . Core . Brain

Serialized Fields

Default Action :: Action

The Default Action is Instantiated during Unity’s call to Start and set to be the current Action.

Current Action :: Action

The Current Action is serialized only for debugging purposes and should not be set in the editor.

Methods

Set Action ( New Action :: Action )

Guards against null and same Actions. Pushes the Current Action onto the stack and then Replaces the Current Action with the New Action.

Replace Action ( New Action :: Action )

Cancels the Current Action and then Instantiates and Initializes a new instance of the New Action and sets it to be the Current Action.

Clear Action ( )

Cancels the Current Action and pops the Last Action off of the stack. The Last Action becomes the Current Action and Restart is called on that action. If the stack was empty, sets a new instance of the Default Action to be the Current Action.

Unity Methods

Start ( )

Instantiates and Initializes a new instance of the Default Action and sets it as the Current Action.

Update ( )

Executes the Current Action.