Exemplo n.º 1
0
        public bool InitData(int partID)
        {
            this.partID = partID;
            _partsMeta  = AssembleModule.GetAssemblePartDataByKey(partID);

            if (_partsMeta != null)
            {
                baseTimeCost     = _partsMeta.BaseTimeCost;
                materialCostItem = AssembleModule.GetPartMaterialCost(partID);
                partsConfig      = AssembleModule.GetPartsCustomConfigData(partID);
                partEquipType    = AssembleModule.GetAssemblePartEquipType(partID);
                typePresetData   = new AssemblePartTypePresetData(_partsMeta.ModelTypeID);
                modifierRootType = AssembleModule.FetchAssemblePartModifieRootType(typePresetData.TypeID);
                return(true);
            }
            return(false);
        }
Exemplo n.º 2
0
        void RefreshPartCost()
        {
            var _partCostTrans = transform.FindTransfrom("Content/PartCost/Content");

            _partCostTrans.SafeSetActiveAllChild(false);

            var costList = AssembleModule.GetPartMaterialCost(_model.ID);

            for (int i = 0; i < costList.Count; i++)
            {
                if (i > Config.GlobalConfigData.Assemble_MaterialCost_MaxNum)
                {
                    break;
                }
                var cmpt = UIUtility.SafeGetComponent <MaterialCostCmpt>(_partCostTrans.GetChild(i));
                if (cmpt != null)
                {
                    cmpt.SetUpItem(costList[i]);
                    cmpt.gameObject.SetActive(true);
                }
            }
        }