public void SetUnitIcon(Image_Transparent image, UnitParam unit_param)
        {
            if (Object.op_Equality((Object)image, (Object)null) || unit_param == null)
            {
                return;
            }
            SpriteSheet spriteSheet = AssetManager.Load <SpriteSheet>("ItemIcon/small");
            ItemParam   itemParam   = MonoSingleton <GameManager> .Instance.GetItemParam(unit_param.piece);

            image.set_sprite(spriteSheet.GetSprite(itemParam.icon));
        }
Exemplo n.º 2
0
        private void CreateGoldObjects(Transform parent)
        {
            if (this.mCurrentQuest != null && !this.mCurrentQuest.IsVersus)
            {
                return;
            }
            if ((int)this.mResultData.Record.gold <= 0)
            {
                return;
            }
            GameObject gameObject = (GameObject)UnityEngine.Object.Instantiate <GameObject>((M0)this.TreasureListItem);

            gameObject.get_transform().SetParent(parent, false);
            this.mTreasureListItems.Add(gameObject);
            gameObject.SetActive(true);
            Transform child1 = gameObject.get_transform().FindChild("BODY/frame");

            if (UnityEngine.Object.op_Inequality((UnityEngine.Object)child1, (UnityEngine.Object)null))
            {
                Image_Transparent component = (Image_Transparent)((Component)child1).GetComponent <Image_Transparent>();
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object)component, (UnityEngine.Object)null) && UnityEngine.Object.op_Inequality((UnityEngine.Object) this.GoldFrame, (UnityEngine.Object)null))
                {
                    component.set_sprite(this.GoldFrame);
                }
            }
            Transform child2 = gameObject.get_transform().FindChild("BODY/itemicon");

            if (UnityEngine.Object.op_Inequality((UnityEngine.Object)child2, (UnityEngine.Object)null))
            {
                RawImage_Transparent component = (RawImage_Transparent)((Component)child2).GetComponent <RawImage_Transparent>();
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object)component, (UnityEngine.Object)null) && UnityEngine.Object.op_Inequality((UnityEngine.Object) this.GoldTex, (UnityEngine.Object)null))
                {
                    component.set_texture((Texture)this.GoldTex);
                }
            }
            Transform child3 = gameObject.get_transform().FindChild("BODY/amount/Text_amount");

            if (!UnityEngine.Object.op_Inequality((UnityEngine.Object)child3, (UnityEngine.Object)null))
            {
                return;
            }
            BitmapText component1 = (BitmapText)((Component)child3).GetComponent <BitmapText>();

            if (!UnityEngine.Object.op_Inequality((UnityEngine.Object)component1, (UnityEngine.Object)null))
            {
                return;
            }
            component1.text = this.mResultData.Record.gold.ToString();
        }