コード例 #1
0
ファイル: UpdateUIWorker.cs プロジェクト: iorilan/Samples
 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
ファイル: GameView.cs プロジェクト: BoenYang/DeathOfDesginer
    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
ファイル: RegistPanel.cs プロジェクト: liuzhili1994/DouDiZhu
    // 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
ファイル: UpdateUIWorker.cs プロジェクト: iorilan/Samples
        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
ファイル: GameView.cs プロジェクト: BoenYang/DeathOfDesginer
    private void OnNextTurn(UIMsg msg)
    {
        int turnCount = (int)msg.args[0];

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