Esempio n. 1
0
    /// <summary>
    /// 进度条刷新
    /// </summary>
    private void UpdateTime()
    {
        if (IsUpdateTime)
        {
            if (m_Needtime <= 0)
            {
                IsUpdateTime = false;
            }
            IsUpdateTime = true;
            m_Needtime--;
            float prog = m_MaxTime <= 0 ? 0 : (m_MaxTime - m_Needtime) / (float)m_MaxTime;
            if (prog >= 1)
            {
                m_ProgressRootImage.fillAmount = 0;
            }
            m_Progress = prog;
            string str = TimeUtil.GetTimeStr((long)m_Needtime);
            m_BlueprintStateLabel.text     = string.Format(TableUtil.GetLanguageString("production_title_1058"), str);
            m_ProgressRootImage.fillAmount = m_Progress;
            ProduceInfoVO gird = null;
            if (m_FoundryProxy.GetBluePrintDic().TryGetValue(m_TID, out gird))
            {
                gird.BluePrintState = prog >= 1 ? ProduceState.Finsh : gird.BluePrintState;
                gird.Progress       = prog;

                if (gird.BluePrintState == ProduceState.Finsh)
                {
                    RefreshData(1f, ProduceState.Finsh);
                    GameFacade.Instance.SendNotification(NotificationName.MSG_PRODUT_UPDATE, gird.BluePrintState);
                }
            }
        }
    }
Esempio n. 2
0
    private void OnSelectionDataChanged(object obj)
    {
        if (!m_Discard)
        {
            SetHotKeyEnabled(UIAction.Product_ProduceAndCollect, false, 0, false);
        }

        if (obj is ProduceInfoVO)
        {
            ProduceInfoVO item = obj as ProduceInfoVO;
            m_SelectProduceTid = item.TID;
            if (m_OldProduceTid != m_SelectProduceTid)
            {
                m_OldProduceTid = m_SelectProduceTid;
            }
            if (m_FoundryProxy.GetBluePrintDic().TryGetValue(m_SelectProduceTid, out ProduceInfoVO girdInfo))
            {
                RefreshHotKey(girdInfo.BluePrintState);
            }
        }
        else
        {
            m_SelectProduceTid = 0;
            if (m_OldProduceTid != m_SelectProduceTid)
            {
                m_OldProduceTid = m_SelectProduceTid;
            }
            SetHotKeyEnabled(UIAction.Product_ProduceAndCollect, false, 0, false);
            SetHotKeyEnabled(UIAction.Product_Cancel, false, 0, false);
        }
    }