Feel  3.16
The best way to improve your game's feel and make it extra juicy
MMStateMachine.cs File Reference

Classes

struct  MoreMountains.Tools.MMStateChangeEvent< T >
 
interface  MoreMountains.Tools.MMIStateMachine
 Public interface for the state machine. More...
 
class  MoreMountains.Tools.MMStateMachine< T >
 StateMachine manager, designed with simplicity in mind (as simple as a state machine can be anyway). To use it, you need an enum. For example : public enum CharacterConditions { Normal, ControlledMovement, Frozen, Paused, Dead } Declare it like so : public StateMachine<CharacterConditions> ConditionStateMachine; Initialize it like that : ConditionStateMachine = new StateMachine<CharacterConditions>(); Then from anywhere, all you need to do is update its state when needed, like that for example : ConditionStateMachine.ChangeState(CharacterConditions.Dead); The state machine will store for you its current and previous state, accessible at all times, and will also optionnally trigger events on enter/exit of these states. More...
 

Namespaces

namespace  MoreMountains
 
namespace  MoreMountains.Tools