IEnumerator ResLoad() { GF.ShowView <LoadingView>(); GF.Send(EventDef.HallLoading, new LoadingStatus(LTKey.LOADING_UI, 0)); yield return(new WaitForSeconds(0.2f)); GF.Send(EventDef.HallLoading, new LoadingStatus(LTKey.LOADING_UI, 15)); yield return(new WaitForSeconds(0.2f)); GF.Send(EventDef.HallLoading, new LoadingStatus(LTKey.LOADING_UI, 30)); yield return(new WaitForSeconds(0.1f)); GF.Send(EventDef.HallLoading, new LoadingStatus(LTKey.LOADING_UI, 45)); yield return(new WaitForSeconds(0.1f)); OnLoadFinished(); }
public override void Update() { if (!m_lastConnected && GF.GetProxy <SosProxy>().isConnected) { GF.Send(EventDef.HallLoading, new LoadingStatus(LTKey.LOADING_WAIT_LOGIN, 70)); } m_lastConnected = GF.GetProxy <SosProxy>().isConnected; if (!m_lastLogin && GF.GetProxy <SosProxy>().isLogin) { GF.Send(EventDef.HallLoading, new LoadingStatus(LTKey.GENRAL_START, 98)); Task.WaitFor(1f, () => { GF.ChangeState <BattleState>(); }); } m_lastLogin = GF.GetProxy <SosProxy>().isLogin; }
private void Connect() { GF.Send(EventDef.HallLoading, new LoadingStatus(LTKey.LOADING_WAIT_RESPONSE, 50)); GF.GetProxy <HallProxy>().Connect(); Task.WaitFor(3f, () => { if (!GF.GetProxy <HallProxy>().isConnected) { MessageBox.Show("连接失败", "连接服务器失败,是否重新连接?", MessageBoxStyle.OKClose , (result) => { if (result.result == MessageBoxResultType.OK) { Connect(); } }); } }); }
public void Connect() { m_needReconnnect = false; network.Connect(); Task.WaitFor(3f, () => { if (!GF.GetProxy <HallProxy>().isConnected) { MessageBox.Show("连接失败", "连接服务器失败,是否重新连接?", MessageBoxStyle.OKClose , (result) => { if (result.result == MessageBoxResultType.OK) { Connect(); } }); } }); }
void OnMatchSuccess(CMMatchSuccess msg) { battleServerInfo = msg.BattleServerInfo; SendEvent(EventDef.MatchSuccess); GF.ChangeState <BattleLoadingState>(); }
private void Connect() { GF.Send(EventDef.HallLoading, new LoadingStatus(LTKey.LOADING_WAIT_RESPONSE, 50)); GF.GetProxy <HallProxy>().Connect(); }
public void UnRegister <T>(string eventName, Action <T> callback) { GF.UnRegister(eventName, callback); }
public void Register(string eventName, Action callback) { GF.Register(eventName, callback); registedEvents.Add(new RegistedEvent(eventName, callback.Target.GetHashCode())); }
public void SendEvent <T>(string eventName, T evtBody) { GF.Send(eventName, evtBody); }
public void SendEvent(string eventName, object obj = null) { GF.Send(eventName, obj); }
public override void Enter(params object[] param) { GF.ShowView <BattleView>(); }
public static void Show(string title, string msg, MessageBoxStyle style, Action <MessageBoxResult> callback = null) { GF.Send(EventDef.MessageBox, new MessageBoxEvent(title, msg, style, callback)); }
public override void Enter(params object[] param) { GF.GetProxy <SosProxy>().Reset(); GF.GetProxy <SosProxy>().InitSocket(); Connect(); }
private void ReconnectToBattle() { needReconnectBattle = true; GF.ChangeState <BattleLoadingState>(); }
private void OnLoadFinished() { GF.ChangeState <HallLoginState>(); }
public override void Enter(params object[] param) { GF.StartCoroutine(ResLoad()); }