void OnCollisionEnter2D(Collision2D collision) { Bullet bullet = collision.gameObject.GetComponent <Bullet>(); Debug.Log("碰撞!"); dispatcher.DispatchWith("Collision", bullet); }
/// <summary> /// 显示模块 /// </summary> /// <param name="name"></param> /// <param name="data"></param> public void ShowModule(ModuleName name, object data = null) { if (showModule != ModuleName.None) { lastModules.Add(showModule); } showModule = name; dispatcher.DispatchWith(GameEvent.SHOW_MODULE, new ModuleEventData(name, data)); }
public void DispatchWith(string type, object data = null) { dispatcher.DispatchWith(type, data); }