Exemple #1
0
        public void SetUpItem(Config.PartsPropertyConfig.ConfigData config)
        {
            if (config == null)
            {
                return;
            }
            _configData = config;

            if (config.PropertyType == 1)
            {
                ///Fix Value
                ValueMin.gameObject.SetActive(false);
                DotTrans.gameObject.SetActive(false);

                ValueMax.text = ValueFormat(config, (float)config.PropertyValue);
            }
            else if (config.PropertyType == 2)
            {
                ///Value Range
                ValueMin.gameObject.SetActive(true);
                DotTrans.gameObject.SetActive(true);

                ValueMax.text = ValueFormat(config, (float)config.PropertyRangeMax);
                ValueMin.text = ValueFormat(config, (float)config.PropertyRangeMin);
            }

            var typeData = AssembleModule.GetAssemblePartPropertyTypeData(config.Name);

            if (typeData != null)
            {
                transform.FindTransfrom("Icon").SafeGetComponent <Image>().sprite = Utility.LoadSprite(typeData.PropertyIcon);
                transform.FindTransfrom("Name").SafeGetComponent <Text>().text    = MultiLanguage.Instance.GetTextValue(typeData.PropertyName);
            }
        }
Exemple #2
0
 /// <summary>
 /// Data Create
 /// </summary>
 public void InitData(Config.PartsPropertyConfig.ConfigData config, float min, float max,
                      Dictionary <string, AssemblePartPropertyDetailInfo> detailDic, Dictionary <string, AssemblePartTimeCostDetialInfo> timeCostDetailInfoDic)
 {
     InitData(config);
     propertyValueMin           = min;
     propertyValueMax           = max;
     detailInfoDic              = detailDic;
     this.timeCostDetailInfoDic = timeCostDetailInfoDic;
 }
Exemple #3
0
            public CustomData InitData(Config.PartsPropertyConfig.ConfigData config)
            {
                CustomData data = new CustomData();

                propertyName        = config.Name;
                propertyType        = config.PropertyType;
                propertyOriginValue = (float)config.PropertyValue;
                propertyTypeData    = AssembleModule.GetAssemblePartPropertyTypeData(config.Name);
                if (propertyTypeData != null)
                {
                    propertyNameText = MultiLanguage.Instance.GetTextValue(propertyTypeData.PropertyName);
                    propertyIcon     = Utility.LoadSprite(propertyTypeData.PropertyIcon);
                }
                return(data);
            }
Exemple #4
0
        string ValueFormat(Config.PartsPropertyConfig.ConfigData config, float value)
        {
            var propertyData = AssembleModule.GetAssemblePartPropertyTypeData(config.Name);

            return(ValueFormat(propertyData, value));
        }