コード例 #1
0
        public void Init(EquipmentInfoData _equipmentinfodata, int modelid)
        {
            this.modelID = _equipmentinfodata.ModelId.ToString();
            this.equipID = _equipmentinfodata.EquipmentId.ToString();
            SysGameItemsVo dataById = BaseDataMgr.instance.GetDataById <SysGameItemsVo>(this.ModelID);

            try
            {
                this.variety = int.Parse(dataById.sub_type.Split(new char[]
                {
                    '|'
                })[1]);
            }
            catch (Exception var_1_62)
            {
            }
            this.classification      = dataById.quality;
            this.runesclassification = (RunesClassification)this.classification;
            this.runesvariety        = (RunesVariety)this.variety;
            UIEventListener.Get(this.rune_inlay.gameObject).onClick   = new UIEventListener.VoidDelegate(this.ClickItem);
            UIEventListener.Get(this.rune_demount.gameObject).onClick = new UIEventListener.VoidDelegate(this.ClickItem);
            this.count            = _equipmentinfodata.Count;
            this.rune_number.text = this.count.ToString();
            if (_equipmentinfodata.Count < 0)
            {
                this.rune_number.text = "0";
            }
            this.rune_compound.gameObject.SetActive(false);
            if (modelid != 0)
            {
                bool flag = modelid == int.Parse(this.modelID);
                this.runesstate = ((!flag) ? RunesState.UnEquiped : RunesState.Equipted);
                this.rune_inlay.gameObject.SetActive(!flag);
                this.rune_demount.gameObject.SetActive(flag);
            }
            else
            {
                this.runesstate = RunesState.UnEquiped;
                this.rune_number.gameObject.SetActive(true);
                this.rune_inlay.gameObject.SetActive(true);
                this.rune_demount.gameObject.SetActive(false);
            }
            this.Details(dataById);
        }
コード例 #2
0
        private void Details(SysGameItemsVo gameitems)
        {
            this.rune_name.text = LanguageManager.Instance.GetStringById(gameitems.name);
            RunesState runesState = this.runesstate;

            if (runesState != RunesState.UnEquiped)
            {
                if (runesState == RunesState.Equipted)
                {
                    this.rune_state.text = "剩余:";
                }
            }
            else
            {
                this.rune_state.text = "剩余:";
            }
            switch (gameitems.quality)
            {
            case 2:
                this.rune_name.color = new Color(0.003921569f, 0.509803951f, 0.8745098f);
                break;

            case 3:
                this.rune_name.color = new Color(0.6509804f, 0f, 0.7882353f);
                break;

            case 4:
                this.rune_name.color = new Color(0.7411765f, 0.419607848f, 0f);
                break;

            case 5:
                this.rune_name.color = new Color(0.7490196f, 0.5803922f, 0f);
                break;
            }
            string[] array = gameitems.attribute.Split(new char[]
            {
                '|'
            });
            this.rune_attribute.text = ((!(array[1].Substring(array[1].Length - 1, 1) == "%")) ? ("+" + float.Parse(array[1]).ToString(array[2]) + LanguageManager.Instance.GetStringById(BaseDataMgr.instance.GetAttrNumberData(array[0]).attrName)) : ("+" + array[1] + LanguageManager.Instance.GetStringById(BaseDataMgr.instance.GetAttrNumberData(array[0]).attrName)));
            this.rune_bg.spriteName  = gameitems.icon;
        }