public void notify(GameObject obj, ObsEvent _event) { foreach (IObserver observer in _observers) { observer.onNotify(obj, _event); } }
public void onNotify(GameObject obj, ObsEvent _event) { switch (_event) { case ObsEvent.PLAYER_MOVED: Debug.Log("You moved... Nice"); PlayerMoved(); break; case ObsEvent.TARGETS_DOWN: Debug.Log("You learned to shoot... Nice"); TargetsDown(); break; case ObsEvent.Player_JUMPED: Debug.Log("You learned to jump... Nice"); PlayerJumped(); break; case ObsEvent.TUTORIAL_DONE: Debug.Log("Your now a bunny killer... Nice"); TutorialDone(); break; case ObsEvent.GAME_BEGINS: Debug.Log("Let your Hatred consume you"); GameBegins(); break; case ObsEvent.ADRENALINE_RUSH: Debug.Log("Adrenaline Rush Activate, Your a monster!"); AdrenalineRush(); break; default: break; } }
/// <summary> /// �ƥ����O�u�t /// </summary> /// <param name="type">�ƥ����O���A</param> /// <param name="row">�ƥ���</param> /// <returns></returns> private AEvent categoryFactory(CategoryType type,System.Collections.Hashtable ht) { AEvent category = null; switch (type) { case CategoryType.GEN: category = new GenEvent(ht, type); break; case CategoryType.OBS: category = new ObsEvent(ht, type); break; case CategoryType.OTH: category = new OthEvent(ht, type); break; case CategoryType.RES: category = new ResEvent(ht, type); break; case CategoryType.TUN: category = new TunEvent(ht, type); break; case CategoryType.WEA: category = new WeaEvent(ht, type); break; } return category; }