예제 #1
0
 private void ProcessUIMsg(UIMsg msg)
 {
     if (msg.Success)
     {
         _picboxCollection.ShowSuccess(msg.Msg);
     }
     else
     {
         _picboxCollection.ShowError(msg.Msg);
     }
 }
예제 #2
0
    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;
        }
    }
예제 #3
0
    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;
        }
    }
예제 #4
0
    // 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);
    }
예제 #5
0
    // 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);
    }
예제 #6
0
        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)
            {
            }
        }
예제 #7
0
    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);
                }
            }
        }
    }
예제 #8
0
    private void OnNextTurn(UIMsg msg)
    {
        int turnCount = (int)msg.args[0];

        TurnCount.text = string.Format("第{0}个月", turnCount);
    }