PumpkinBehaviour


Description

The PumpkinBehaviour class is a general base class for handling core events and states.

The main feature of the PumpkinBehaviour is the state machine and state scheduler, states can be set and transitioned in simple way. eg. SetState( "Demo" ) will call a method called DemoStart() on the current class and then DemoUpdate() every update until the SetState( "SomeOther" ) is called. When a state changes the StateNameEnd() transition is called.


Functions

OnStart

Behaviour state event.

Update

Behaviour update.

OnUpdate

Update event, called once per frame.

OnDestroy

Internal destroy handler.

OnDestroyBehiavour

Destroy event.

SetState

Set the next state.

SetState

Set the next state with delay.

UpdateSleep

Schedule the next Update() or StateName() update for n seconds from now.

GetStateName

Get the active state name.

IsStateActive

Compare state name to the active one.

GetStateTime

Get the active state run time in seconds.

GetStateTimeMs

Get the active state run time in milliseconds.

RemoveComponent

Remove component by name.

AddComponent

Add component by name


Variables

userData

Associate user data with this behaviour.