//服务器主动发送消息时回调 public void OnEvent(EventData eventData) { ProtocolBase protocol = null; //创建空的协议对象 if (protocolPool.TryGetValue(eventData.Code, out protocol)) { protocol.OnEvent(eventData); } else { Debug.LogError("Error: no operation instance"); } }
static int _m_OnEvent(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); ProtocolBase gen_to_be_invoked = (ProtocolBase)translator.FastGetCSObj(L, 1); { ExitGames.Client.Photon.EventData _eventData = (ExitGames.Client.Photon.EventData)translator.GetObject(L, 2, typeof(ExitGames.Client.Photon.EventData)); gen_to_be_invoked.OnEvent(_eventData); return(0); } } catch (System.Exception gen_e) { return(LuaAPI.luaL_error(L, "c# exception:" + gen_e)); } }