TopDown Engine
v4.1
|
Switches can be used to trigger actions based on their current state (on or off). Useful to open doors, chests, portals, bridges... More...
Public Types | |
enum | SwitchStates { SwitchStates.On, SwitchStates.Off } |
the possible states of the switch More... | |
Public Member Functions | |
virtual void | TurnSwitchOn () |
Turns the switch on More... | |
virtual void | TurnSwitchOff () |
Turns the switch off More... | |
virtual void | ToggleSwitch () |
Use this method to go from one state to the other More... | |
Public Attributes | |
Animator | SwitchAnimator |
a SpriteReplace to represent the switch knob when it's on More... | |
SwitchStates | InitialState = SwitchStates.Off |
the state the switch should start in More... | |
UnityEvent | SwitchOn |
the methods to call when the switch is turned on More... | |
UnityEvent | SwitchOff |
the methods to call when the switch is turned off More... | |
UnityEvent | SwitchToggle |
the methods to call when the switch is toggled More... | |
MMFeedbacks | SwitchOnFeedback |
a feedback to play when the switch is toggled on More... | |
MMFeedbacks | SwitchOffFeedback |
a feedback to play when the switch is turned off More... | |
MMFeedbacks | ToggleFeedback |
a feedback to play when the switch changes state More... | |
bool | SwitchOnButton |
a test button to turn the switch on More... | |
bool | SwitchOffButton |
a test button to turn the switch off More... | |
bool | ToggleSwitchButton |
a test button to change the switch's state More... | |
Protected Member Functions | |
virtual void | Start () |
On init, we set our current switch state More... | |
virtual void | Update () |
On Update, we update our switch's animator More... | |
Properties | |
virtual SwitchStates | CurrentSwitchState [get, set] |
the current state of the switch More... | |
Switches can be used to trigger actions based on their current state (on or off). Useful to open doors, chests, portals, bridges...
|
strong |
|
protectedvirtual |
On init, we set our current switch state
|
virtual |
Use this method to go from one state to the other
|
virtual |
Turns the switch off
|
virtual |
Turns the switch on
|
protectedvirtual |
On Update, we update our switch's animator
SwitchStates MoreMountains.TopDownEngine.Switch.InitialState = SwitchStates.Off |
the state the switch should start in
Animator MoreMountains.TopDownEngine.Switch.SwitchAnimator |
a SpriteReplace to represent the switch knob when it's on
UnityEvent MoreMountains.TopDownEngine.Switch.SwitchOff |
the methods to call when the switch is turned off
bool MoreMountains.TopDownEngine.Switch.SwitchOffButton |
a test button to turn the switch off
MMFeedbacks MoreMountains.TopDownEngine.Switch.SwitchOffFeedback |
a feedback to play when the switch is turned off
UnityEvent MoreMountains.TopDownEngine.Switch.SwitchOn |
the methods to call when the switch is turned on
bool MoreMountains.TopDownEngine.Switch.SwitchOnButton |
a test button to turn the switch on
MMFeedbacks MoreMountains.TopDownEngine.Switch.SwitchOnFeedback |
a feedback to play when the switch is toggled on
UnityEvent MoreMountains.TopDownEngine.Switch.SwitchToggle |
the methods to call when the switch is toggled
MMFeedbacks MoreMountains.TopDownEngine.Switch.ToggleFeedback |
a feedback to play when the switch changes state
bool MoreMountains.TopDownEngine.Switch.ToggleSwitchButton |
a test button to change the switch's state
|
getset |
the current state of the switch