示例#1
0
        public static ConceptCardData CreateConceptCardDataForDisplay(string iname)
        {
            ConceptCardData conceptCardData = new ConceptCardData();

            conceptCardData.Deserialize(new JSON_ConceptCard()
            {
                iid   = 1L,
                iname = iname,
                exp   = 0,
                trust = 0,
                fav   = 0
            });
            return(conceptCardData);
        }
示例#2
0
        private void RefreshRewardIcon(TrophyParam trophy)
        {
            bool      flag1  = false;
            bool      flag2  = false;
            bool      flag3  = false;
            bool      flag4  = false;
            string    str    = string.Empty;
            ItemParam data   = (ItemParam)null;
            bool      flag5  = false;
            string    format = "@{0}";

            if (trophy.Gold != 0)
            {
                flag3 = true;
                str   = string.Format(format, (object)trophy.Gold);
            }
            else if (trophy.Exp != 0)
            {
                flag2 = true;
                str   = string.Format(format, (object)trophy.Exp);
            }
            else if (trophy.Coin != 0)
            {
                flag1 = true;
                data  = MonoSingleton <GameManager> .Instance.GetItemParam("$COIN");

                str = string.Format(format, (object)trophy.Coin);
            }
            else if (trophy.Stamina != 0)
            {
                flag4 = true;
                str   = string.Format(format, (object)trophy.Stamina);
            }
            else if (trophy.Items != null && trophy.Items.Length > 0)
            {
                flag1 = true;
                data  = MonoSingleton <GameManager> .Instance.GetItemParam(trophy.Items[0].iname);

                if (data != null)
                {
                    str = string.Format(format, (object)trophy.Items[0].Num);
                }
            }
            else if (trophy.ConceptCards != null && trophy.ConceptCards.Length > 0)
            {
                flag5 = true;
                str   = string.Format(format, (object)trophy.ConceptCards[0].Num);
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.ImageItem, (UnityEngine.Object)null))
            {
                ((Component)this.ImageItem).get_gameObject().SetActive(flag1);
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.ImageExp, (UnityEngine.Object)null))
            {
                ((Component)this.ImageExp).get_gameObject().SetActive(flag2);
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.ImageGold, (UnityEngine.Object)null))
            {
                ((Component)this.ImageGold).get_gameObject().SetActive(flag3);
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.ImageAp, (UnityEngine.Object)null))
            {
                ((Component)this.ImageAp).get_gameObject().SetActive(flag4);
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.TextReward, (UnityEngine.Object)null))
            {
                this.TextReward.set_text(str);
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.ConceptCard, (UnityEngine.Object)null))
            {
                this.ConceptCard.SetActive(flag5);
            }
            if (flag5)
            {
                ConceptCardIcon component = (ConceptCardIcon)this.ConceptCard.GetComponent <ConceptCardIcon>();
                if (!UnityEngine.Object.op_Inequality((UnityEngine.Object)component, (UnityEngine.Object)null))
                {
                    return;
                }
                ConceptCardData card = new ConceptCardData();
                card.Deserialize(new JSON_ConceptCard()
                {
                    iid   = 1L,
                    iname = trophy.ConceptCards[0].iname,
                    exp   = 0,
                    trust = 0,
                    fav   = 0
                });
                component.Setup(card);
            }
            else
            {
                DataSource.Bind <ItemParam>(((Component)this).get_gameObject(), data);
            }
        }