Example #1
0
        public static Config.PartsCustomConfig GetPartsCustomConfigData(int partID)
        {
            Config.PartsCustomConfig config = null;
            var meta = GetAssemblePartDataByKey(partID);

            if (meta != null)
            {
                config = Config.ConfigData.AssemblePartsConfigData.partsCustomConfig.Find(x => x.customName == meta.CustomData);
            }
            if (config == null)
            {
                Debug.LogError("GetPartsCustomConfigData Error! partID=" + partID);
            }

            return(config);
        }
Example #2
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);
        }