Example #1
0
        private GameObject CreateListItem(EventCoinData eventcoin_data)
        {
            GameObject        gameObject = (GameObject)UnityEngine.Object.Instantiate <GameObject>((M0)this.ItemTemplate);
            EventCoinListItem component1 = (EventCoinListItem)gameObject.GetComponent <EventCoinListItem>();
            Button            component2 = (Button)component1.Button.GetComponent <Button>();
            ListItemEvents    component3 = (ListItemEvents)component1.Button.GetComponent <ListItemEvents>();

            if (UnityEngine.Object.op_Inequality((UnityEngine.Object)component2, (UnityEngine.Object)null) && UnityEngine.Object.op_Inequality((UnityEngine.Object)component3, (UnityEngine.Object)null))
            {
                EventShopListItem eventShopListItem = GlobalVars.EventShopListItems.Find((Predicate <EventShopListItem>)(f => f.shop_cost_iname.Equals(eventcoin_data.iname)));
                bool flag = false;
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object)eventShopListItem, (UnityEngine.Object)null) && eventShopListItem.shops != null && eventShopListItem.shops.unlock != null && (eventShopListItem.shops.unlock.flg != 1 ? 0 : 1) != 0)
                {
                    flag = true;
                }
                if (flag)
                {
                    component3.OnSelect = new ListItemEvents.ListItemEvent(this.OnSelect);
                    ((Selectable)component2).set_interactable(true);
                }
                else
                {
                    ((Selectable)component2).set_interactable(false);
                }
            }
            return(gameObject);
        }
Example #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);
            }
        }
Example #3
0
        private void OnSelect(GameObject go)
        {
            EventCoinData coindata = DataSource.FindDataOfClass <EventCoinData>(go, (EventCoinData)null);

            if (coindata.iname == null)
            {
                return;
            }
            GlobalVars.SelectionCoinListType = GlobalVars.CoinListSelectionType.EventShop;
            GlobalVars.SelectionEventShop    = GlobalVars.EventShopListItems.Find((Predicate <EventShopListItem>)(f => f.EventShopInfo.shop_cost_iname.Equals(coindata.iname)));
            FlowNode_GameObject.ActivateOutputLinks((Component)this, 101);
        }
Example #4
0
        private void UpdateItems()
        {
            MonoSingleton <GameManager> .Instance.Player.UpdateEventCoin();

            if (UnityEngine.Object.op_Equality((UnityEngine.Object) this.ItemTemplate, (UnityEngine.Object)null))
            {
                return;
            }
            List <EventCoinData> eventCoinList = MonoSingleton <GameManager> .Instance.Player.EventCoinList;
            Transform            transform     = ((Component)this).get_transform();

            for (int index = 0; index < eventCoinList.Count; ++index)
            {
                GameObject listItem = this.CreateListItem(eventCoinList[index]);
                listItem.get_transform().SetParent(transform, false);
                this.mEventCoinListItems.Add(listItem);
                listItem.SetActive(true);
                EventCoinData data = eventCoinList[index];
                DataSource.Bind <EventCoinData>(listItem, data);
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.ArenaTemplate, (UnityEngine.Object)null))
            {
                GameObject otherListItem = this.CreateOtherListItem(this.ArenaTemplate, new ListItemEvents.ListItemEvent(this.OnSelectArenaShop), MonoSingleton <GameManager> .Instance.Player.CheckUnlock(UnlockTargets.Arena));
                otherListItem.get_transform().SetParent(transform, false);
                this.mEventCoinListItems.Add(otherListItem);
                otherListItem.SetActive(true);
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.MultiTemplate, (UnityEngine.Object)null))
            {
                GameObject otherListItem = this.CreateOtherListItem(this.MultiTemplate, new ListItemEvents.ListItemEvent(this.OnSelectMultiShop), true);
                otherListItem.get_transform().SetParent(transform, false);
                this.mEventCoinListItems.Add(otherListItem);
                otherListItem.SetActive(true);
            }
            GameParameter.UpdateAll(((Component)this).get_gameObject());
        }