private void ProcessUIMsg(UIMsg msg) { if (msg.Success) { _picboxCollection.ShowSuccess(msg.Msg); } else { _picboxCollection.ShowError(msg.Msg); } }
public override void Execute(int eventCode, object message) { switch (eventCode) { case UIEvent.MessageInfoPanel: UIMsg uiMsg = message as UIMsg; ShowUIPanel(uiMsg.message, uiMsg.color); break; default: break; } }
private void OnRestartGame(UIMsg msg) { healthValue = (int[])msg.args[0]; currentEventConfig = msg.args[1] as EventConfig; ChooseDesc.text = currentEventConfig.Event; RoleName.text = roleNameDict[currentEventConfig.Hero]; TurnCount.text = string.Format("第1个月"); for (int i = 0; i < healthValue.Length; i++) { Bars[i].fillAmount = healthValue[i] / 100f; } }
// Use this for initialization void Start() { uiMsg = new UIMsg(); serverMsg = new MessageData(); btnReigist = transform.Find("btnReigist").GetComponent <Button>(); btnClose = transform.Find("btnClose").GetComponent <Button>(); inputAccount = transform.Find("inputAccount").GetComponent <InputField>(); inputPassword = transform.Find("inputPassword").GetComponent <InputField>(); inputRepeat = transform.Find("inputRepeat").GetComponent <InputField>(); btnClose.onClick.AddListener(CloseClick); btnReigist.onClick.AddListener(RegistClick); SetPanelActive(false); }
// Use this for initialization void Start() { uiMsg = new UIMsg(); serverMsg = new MessageData(); btnLogin = transform.Find("btnLogin").GetComponent <Button>(); btnClose = transform.Find("btnClose").GetComponent <Button>(); inputAccount = transform.Find("inputAccount").GetComponent <InputField>(); inputPassword = transform.Find("inputPassword").GetComponent <InputField>(); btnLogin.onClick.AddListener(LoginClick); btnClose.onClick.AddListener(CloseClick); //面板需要默认隐藏 SetPanelActive(false); }
private void UpdateMsg(object sender, DoWorkEventArgs e) { try { if (ProgramIdleChecker.GetIdleTime() > IDLE_SEC * 1000 && ProgramIdleChecker.GetUserIdleSeconds() > IDLE_SEC) { try { _picboxCollection.ShowVideo(); } catch (Exception ex) { _log.Error("[UpdateMsg - Play video] -==>" + ex.Message + "\r\n" + ex.StackTrace); } } else { UIMsg msg = MsgManager.Instance.TryTake(); if (msg != null && !string.IsNullOrWhiteSpace(msg.Msg)) { _picboxCollection.ShowScan(); MsgsUpdatedAt = DateTime.Now; ProcessUIMsg(msg); } else { if ((DateTime.Now - MsgsUpdatedAt).TotalSeconds > ValidatorEnv.MsgShowingTime) { MsgsUpdatedAt = DateTime.Now; Reset(); } } } } catch (Exception ex) { } }
private void _DispatchMsg(string msgType, params object[] args) { UIMsg m = new UIMsg(); m.MsgType = msgType; m.args = args; if (uiMsgDict.ContainsKey(msgType)) { List <UIMsgCallback> listenerList = uiMsgDict[msgType]; for (int i = 0; i < listenerList.Count; i++) { UIMsgCallback listener = listenerList[i]; if (listener.Method.IsStatic) { listener.Invoke(m); } else if (listener.Target != null) { listener.Invoke(m); } } } }
private void OnNextTurn(UIMsg msg) { int turnCount = (int)msg.args[0]; TurnCount.text = string.Format("第{0}个月", turnCount); }