|
|
|
|
|
|
|
|
|
|
|
|
|
|
class StateMachine: |
|
|
class StateMachine: |
|
|
def __init__(self): |
|
|
def __init__(self): |
|
|
pass |
|
|
Events.listen("SCENECHANGE", self.on_scenechange) |
|
|
|
|
|
|
|
|
|
|
|
def on_scenechange(self, event, params): |
|
|
|
|
|
if "scene" in params and "hold" in params: |
|
|
|
|
|
self.activate_node(params["scene"], params["hold"]) |
|
|
|
|
|
|
|
|
def has_node(self, name): |
|
|
def has_node(self, name): |
|
|
""" |
|
|
""" |
|
|
|
|
|
|
|
|
_TIME.reset() |
|
|
_TIME.reset() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def _relaseActive(self, hold_previous): |
|
|
def _releaseActive(self, hold_previous): |
|
|
global _ACTIVE_STATE, _HOLD_STATE |
|
|
global _ACTIVE_STATE, _HOLD_STATE |
|
|
a = _ACTIVE_STATE |
|
|
a = _ACTIVE_STATE |
|
|
a._pause() |
|
|
a._pause() |