//sample handler definitions //private TutorialInput_Handler nodFunc = () => { print("nod"); }; //private TutorialInput_Handler lookFunc = () => { print("look"); }; //main interface: USE ME to subscribe a sepcific type of input event //type: see the enum definition for different input types. //handler: your event handler. (will be called once the input condition is satisfied) public void RegisterEvent(TutorialInputType type, TutorialInput_Handler handler) { switch (type) { case TutorialInputType.NoddingHead: { _OnNoddingHead += handler; if (_currNoddingHeadCR == null && presenter != null) { _currNoddingHeadCR = StartCoroutine(NoddingHead_CR()); } break; } case TutorialInputType.LookAtScreen: { _OnLookAtScreen += handler; if (_currLookingAtCR == null && presenter != null) { _currLookingAtCR = StartCoroutine(LookingAt_CR()); } break; } default: break; } }
//main interface: USE ME to unsubscribe a sepcific type of input event //MAKE SURE to use UnRegisterEvent IN PAIR with ResgisterEvent public void UnRegisterEvent(TutorialInputType type, TutorialInput_Handler handler) { switch (type) { case TutorialInputType.NoddingHead: { _OnNoddingHead -= handler; break; } case TutorialInputType.LookAtScreen: { _OnLookAtScreen -= handler; break; } default: break; } }
//main interface: USE ME to unsubscribe a sepcific type of input event //MAKE SURE to use UnRegisterEvent IN PAIR with ResgisterEvent public void UnRegisterEvent(TutorialInputType type, TutorialInput_Handler handler) { switch (type) { case TutorialInputType.NoddingHead: { _OnNoddingHead -= handler; break; } case TutorialInputType.LookAtScreen: { _OnLookAtScreen -= handler; break; } default: break; } }
//sample handler definitions //private TutorialInput_Handler nodFunc = () => { print("nod"); }; //private TutorialInput_Handler lookFunc = () => { print("look"); }; //main interface: USE ME to subscribe a sepcific type of input event //type: see the enum definition for different input types. //handler: your event handler. (will be called once the input condition is satisfied) public void RegisterEvent(TutorialInputType type, TutorialInput_Handler handler) { switch (type) { case TutorialInputType.NoddingHead: { _OnNoddingHead += handler; if (_currNoddingHeadCR == null && presenter != null) _currNoddingHeadCR = StartCoroutine(NoddingHead_CR()); break; } case TutorialInputType.LookAtScreen: { _OnLookAtScreen += handler; if (_currLookingAtCR == null && presenter != null) _currLookingAtCR = StartCoroutine(LookingAt_CR()); break; } default: break; } }