// called in worker thread void OnConnected(networking.Chan chan) { var sess = new Session(); chan.recvHandler += sess.HandleRecv; #if UNITY_EDITOR chan.recvHandler += OnStatRecv; chan.onSend += OnStatSend; #endif utils.TaskManager.PerformOnMainThread( (obj) => { var id = (long)onConnected.Invoke1(chan); sess.id = (int)id; sessions.Add(sess); }); }
ReturnType GenericFunc <ReturnType>() { return((ReturnType)Lua.ConvertTo(func.Invoke1(), typeof(ReturnType))); }