protected override void SetPauseMechanism() { StratusScene.Connect <PauseEvent>(this.OnPauseEvent); gameObject.Connect <PauseEvent>(this.OnPauseEvent); StratusScene.Connect <ResumeEvent>(this.OnResumeEvent); gameObject.Connect <ResumeEvent>(this.OnResumeEvent); }
//------------------------------------------------------------------------/ // Messages //------------------------------------------------------------------------/ private void Awake() { // Optionally, subscribe to scene-wide events if (scope == StratusEvent.Scope.Scene) { StratusScene.Connect <StateEvent>(this.OnStateEvent); } // Always subscribe to specific requests gameObject.Connect <StateEvent>(this.OnStateEvent); AddCommonRecorders(); }
private void Subscribe() { switch (scope) { case StratusEvent.Scope.GameObject: this.gameObject.Connect(this.OnEvent, this.type); break; case StratusEvent.Scope.Scene: StratusScene.Connect(this.OnEvent, this.type); break; } connected = true; }
//------------------------------------------------------------------------/ // Messages //------------------------------------------------------------------------/ protected override void OnAwake() { StratusScene.Connect <StratusPauseEvent>(this.OnPauseEvent); StratusScene.Connect <StratusResumeEvent>(this.OnResumeEvent); }