Ejemplo n.º 1
0
 private void Update()
 {
     if (this.mLoadRequest == null || Object.op_Equality((Object)this.mTarget, (Object)null))
     {
         ((Behaviour)this).set_enabled(false);
     }
     else
     {
         if (!this.mLoadRequest.isDone)
         {
             return;
         }
         BannerParam dataOfClass = DataSource.FindDataOfClass <BannerParam>(((Component)this).get_gameObject(), (BannerParam)null);
         if (dataOfClass == null)
         {
             return;
         }
         GachaTabSprites asset = this.mLoadRequest.asset as GachaTabSprites;
         if (Object.op_Inequality((Object)asset, (Object)null) && asset.Sprites != null && asset.Sprites.Length > 0)
         {
             Sprite[] sprites = asset.Sprites;
             for (int index = 0; index < sprites.Length; ++index)
             {
                 if (Object.op_Inequality((Object)sprites[index], (Object)null) && ((Object)sprites[index]).get_name() == dataOfClass.banr_sprite)
                 {
                     this.mTarget.set_sprite(sprites[index]);
                 }
             }
         }
         ((Behaviour)this).set_enabled(false);
     }
 }
Ejemplo n.º 2
0
        public void SetShopList(JSON_ShopListArray.Shops shops, Json_ShopMsgResponse msg)
        {
            this.EventShopInfo.shops = shops;
            if (msg != null)
            {
                this.EventShopInfo.banner_sprite   = msg.banner;
                this.EventShopInfo.shop_cost_iname = msg.costiname;
                if (msg.update != null)
                {
                    this.EventShopInfo.btn_update = msg.update.Equals("on");
                }
            }
            GachaTabSprites gachaTabSprites = AssetManager.Load <GachaTabSprites>(this.EventShopSpritePath);

            if (UnityEngine.Object.op_Inequality((UnityEngine.Object)gachaTabSprites, (UnityEngine.Object)null) && gachaTabSprites.Sprites != null && gachaTabSprites.Sprites.Length > 0)
            {
                Sprite[] sprites = gachaTabSprites.Sprites;
                for (int index = 0; index < sprites.Length; ++index)
                {
                    if (UnityEngine.Object.op_Inequality((UnityEngine.Object)sprites[index], (UnityEngine.Object)null) && ((UnityEngine.Object)sprites[index]).get_name() == this.EventShopInfo.banner_sprite)
                    {
                        this.banner.set_sprite(sprites[index]);
                    }
                }
            }
            EventCoinData data = MonoSingleton <GameManager> .Instance.Player.EventCoinList.Find((Predicate <EventCoinData>)(f => f.iname.Equals(this.EventShopInfo.shop_cost_iname)));

            if (data == null)
            {
                data       = new EventCoinData();
                data.param = MonoSingleton <GameManager> .Instance.MasterParam.Items.Find((Predicate <ItemParam>)(f => f.iname.Equals(this.EventShopInfo.shop_cost_iname)));
            }
            DataSource.Bind <ItemParam>(this.mPaidCoinIcon, data.param);
            DataSource.Bind <EventCoinData>(this.mPaidCoinNum, data);
            if (shops.unlock == null || !UnityEngine.Object.op_Inequality((UnityEngine.Object) this.mLockObject, (UnityEngine.Object)null) || !UnityEngine.Object.op_Inequality((UnityEngine.Object) this.mLockText, (UnityEngine.Object)null))
            {
                return;
            }
            bool   flag      = shops.unlock.flg == 1;
            Button component = (Button)((Component)this).GetComponent <Button>();

            if (!UnityEngine.Object.op_Implicit((UnityEngine.Object)component))
            {
                return;
            }
            if (flag)
            {
                ((Selectable)component).set_interactable(true);
                this.mLockObject.SetActive(false);
                this.mLockText.set_text(string.Empty);
            }
            else
            {
                ((Selectable)component).set_interactable(false);
                this.mLockObject.SetActive(true);
                this.mLockText.set_text(shops.unlock.message != null ? shops.unlock.message : string.Empty);
            }
        }
 public void SetTowerImage(LoadRequest floor_req, int index, string image_name, TowerQuestListItem[] tower_quest_list)
 {
   GachaTabSprites asset = floor_req.asset as GachaTabSprites;
   if (UnityEngine.Object.op_Equality((UnityEngine.Object) asset, (UnityEngine.Object) null))
     return;
   for (int index1 = 0; index1 < asset.Sprites.Length; ++index1)
   {
     if (!(((UnityEngine.Object) asset.Sprites[index1]).get_name() != image_name))
     {
       for (int index2 = 0; index2 < tower_quest_list.Length; ++index2)
       {
         tower_quest_list[index2].Banner[0].Images[index] = asset.Sprites[index1];
         tower_quest_list[index2].Banner[1].Images[index] = asset.Sprites[index1];
       }
     }
   }
 }
Ejemplo n.º 4
0
        public void SetShopList(JSON_ShopListArray.Shops shops)
        {
            this.shops = shops;
            if (shops.info != null)
            {
                if (shops.info.msg != null)
                {
                    Json_ShopMsgResponse jsonShopMsgResponse;
                    try
                    {
                        jsonShopMsgResponse = JSONParser.parseJSONObject <Json_ShopMsgResponse>(shops.info.msg);
                    }
                    catch (Exception ex)
                    {
                        Debug.LogError((object)("Parse failed: " + shops.info.msg));
                        jsonShopMsgResponse = (Json_ShopMsgResponse)null;
                    }
                    if (jsonShopMsgResponse != null)
                    {
                        this.banner_sprite = jsonShopMsgResponse.banner;
                        if (jsonShopMsgResponse.update != null)
                        {
                            this.btn_update = jsonShopMsgResponse.update.Equals("on");
                        }
                    }
                }
            }
            GachaTabSprites gachaTabSprites = AssetManager.Load <GachaTabSprites>(this.LimitedShopSpritePath);

            if (!UnityEngine.Object.op_Inequality((UnityEngine.Object)gachaTabSprites, (UnityEngine.Object)null) || gachaTabSprites.Sprites == null || gachaTabSprites.Sprites.Length <= 0)
            {
                return;
            }
            Sprite[] sprites = gachaTabSprites.Sprites;
            for (int index = 0; index < sprites.Length; ++index)
            {
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object)sprites[index], (UnityEngine.Object)null) && ((UnityEngine.Object)sprites[index]).get_name() == this.banner_sprite)
                {
                    this.banner.set_sprite(sprites[index]);
                }
            }
        }