Coroutine
Namespace: Murder.StateMachines
Assembly: Murder.dll
public class Coroutine : StateMachine
This CANNOT and WONT be serialized it is just a bad idea. Remember, we can't (or don't want to) serialize lambdas.
Implements: StateMachine
⭐ Constructors
public Coroutine()
public Coroutine(IEnumerator<T> routine)
Parameters
routine
IEnumerator<T>
⭐ Properties
Entity
protected Entity Entity;
Returns
Entity
Name
public string Name { get; }
Returns
string
PersistStateOnSave
protected virtual bool PersistStateOnSave { get; }
Returns
bool
World
protected World World;
Returns
World
⭐ Methods
OnMessage(IMessage)
protected virtual void OnMessage(IMessage message)
Parameters
message
IMessage
OnStart()
protected virtual void OnStart()
Transition(Func)
protected virtual void Transition(Func<TResult> routine)
Parameters
routine
Func<TResult>
GoTo(Func)
protected virtual Wait GoTo(Func<TResult> routine)
Parameters
routine
Func<TResult>
Returns
Wait
Reset()
protected void Reset()
State(Func)
protected void State(Func<TResult> routine)
Parameters
routine
Func<TResult>
SwitchState(Func)
protected void SwitchState(Func<TResult> routine)
Parameters
routine
Func<TResult>
OnDestroyed()
public virtual void OnDestroyed()
Subscribe(Action)
public void Subscribe(Action notification)
Parameters
notification
Action
Unsubscribe(Action)
public void Unsubscribe(Action notification)
Parameters
notification
Action
⚡