IEnumerator _exit(float delay) { while (syncQueue.Count > 0) { yield return(new WaitForEndOfFrame()); } ReplayMgr rm = ReplayMgr.GetInstance(); GameMgr gm = GameMgr.GetInstance(); RoomMgr room = RoomMgr.GetInstance(); ResourcesMgr.GetInstance().release(); rm.clear(); gm.Reset(); room.reset(); if (delay > 0) { PUtils.setTimeout(() => { LoadingScene.LoadNewScene("02.lobby"); }, delay); } else { LoadingScene.LoadNewScene("02.lobby"); } }
void Start() { Transform me = transform.Find("me"); setText(me, "name", GameMgr.getUserMgr().username); setIcon(me, "icon", GameMgr.getUserMgr().userid); PUtils.setTimeout(() => { Transform items = transform.Find("items"); items.GetComponentInChildren <UIGrid> ().Reposition(); items.GetComponent <UIScrollView> ().ResetPosition(); }, 0.1f); }
public bool checkQuery() { AnysdkMgr am = AnysdkMgr.GetInstance(); string query = am.GetQuery(); if (query == null || query.Length == 0) { return(false); } Dictionary <string, string> ps = PUtils.parseQuery(query); string roomid = ""; int clubid = 0; int gameid = 0; PUtils.setTimeout(() => { am.ClearQuery(); }, 0.1f); if (ps.ContainsKey("room")) { roomid = ps["room"]; } if (ps.ContainsKey("club")) { clubid = int.Parse(ps["club"]); } if (ps.ContainsKey("game")) { gameid = int.Parse(ps["game"]); } if (roomid != "") { enterRoom(roomid); } else if (clubid > 0) { enterClub(clubid); } else if (gameid > 0) { enterGame(gameid); } return(true); }
void Start() { isReplay = ReplayMgr.GetInstance().isReplay(); replay.SetActive(isReplay); refreshBtn(); nextPlayTime = Time.time + 5.0f; if (isReplay) { PUtils.setTimeout(() => { ReplayMgr.GetInstance().sync(); }, 2.0f); } }
static int _m_setTimeout_xlua_st_(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); { System.Action _cb = translator.GetDelegate <System.Action>(L, 1); float _seconds = (float)LuaAPI.lua_tonumber(L, 2); PUtils.setTimeout(_cb, _seconds); return(0); } } catch (System.Exception gen_e) { return(LuaAPI.luaL_error(L, "c# exception:" + gen_e)); } }
void Start() { AudioManager.GetInstance().StopBGM(); GameMgr game = GameMgr.GetInstance(); string roomid = game.userMgr.roomid; PUtils.setTimeout(() => { if (roomid != null && roomid.Length >= 6) { game.enterRoom(roomid, code => { Debug.Log("enter ret=" + code); }); game.userMgr.roomid = null; } else if (!checkQuery()) { resumeClub(); } }, 0.5f); }
void enter(TOUCH_STATE state) { VoiceMgr vm = VoiceMgr.GetInstance(); Debug.Log("enter " + state); switch (state) { case TOUCH_STATE.START: vm.prepare("record.amr"); lastTouchTime = Time.time; voice.SetActive(true); mic.SetActive(true); volume.SetActive(true); cancel.SetActive(false); warning.SetActive(false); time.transform.localScale = new Vector2(0, 1); notice.text = "滑动手指,取消发送"; break; case TOUCH_STATE.MOVE_OUT: if (lastTouchTime > 0) { mic.SetActive(false); volume.SetActive(false); cancel.SetActive(true); warning.SetActive(false); notice.text = "松开手指,取消发送"; } break; case TOUCH_STATE.MOVE_IN: if (lastTouchTime > 0) { mic.SetActive(true); volume.SetActive(true); cancel.SetActive(false); warning.SetActive(false); notice.text = "滑动手指,取消发送"; } break; case TOUCH_STATE.CANCEL: if (lastTouchTime > 0) { vm.cancel(); lastTouchTime = 0; voice.SetActive(false); } break; case TOUCH_STATE.END: if (lastTouchTime > 0) { if (Time.time - lastTouchTime < 1.0f) { vm.cancel(); voice.SetActive(true); mic.SetActive(false); volume.SetActive(false); cancel.SetActive(false); warning.SetActive(true); time.transform.localScale = new Vector2(0, 1); notice.text = "录制时间太短"; PUtils.setTimeout(() => { voice.SetActive(false); }, 1.0f); } else { onVoiceOK(); } lastTouchTime = 0; } break; default: break; } }