Exemple #1
0
        /// <summary>
        /// 更换生产线
        /// </summary>
        /// <param name="formulaID"></param>
        /// <returns></returns>
        bool RefreshFormula(int formulaID)
        {
            if (FormulaModule.GetFormulaDataByID(formulaID) == null)
            {
                return(false);
            }
            ManufactFormulaInfo info = new ManufactFormulaInfo(formulaID, blockBase.info.block);

            ///这里需要初始化一下制造时间
            info.currentNeedTime = (float)info.currentFormulaData.ProductSpeed / (float)manufactoryInfo.CurrentSpeed;

            formulaInfo   = info;
            isfirstChoose = false;
            RefreshFormulaChoose();
            _formulaContentCpmt.Init(info, FormulaContentCmpt.InitType.Normal);

            var manuBase = FunctionBlockManager.Instance.GetManuBlockBase(blockBase.instanceID);

            if (manuBase != null)
            {
                manuBase.formulaInfo = info;
            }

            return(true);
        }
Exemple #2
0
        bool RefreshFormula()
        {
            if (FormulaModule.GetFormulaDataByID(_currentFormulaID) == null)
            {
                return(false);
            }

            ManufactFormulaInfo info = new ManufactFormulaInfo(_currentFormulaID);

            if (_formulaContentCmpt != null)
            {
                _formulaContentCmpt.Init(info, FormulaContentCmpt.InitType.FormulaChange);
                _formulaContentCmpt.RefreshManuElementTrans(info, FormulaContentCmpt.InitType.FormulaChange);
            }

            var currentFormulaData = FormulaModule.GetFormulaDataByID(_currentFormulaID);

            _timeText.text    = currentFormulaData.ProductSpeed.ToString("0.0");
            _formulaName.text = FormulaModule.GetFormulaName(currentFormulaData);
            _desc.text        = FormulaModule.GetFormulaDesc(currentFormulaData);
            typeWriter.StartEffect();
            return(true);
        }