Exemplo n.º 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);
        }
Exemplo n.º 2
0
        private void OnSelectItem(GameObject go)
        {
            EventShopListItem component = (EventShopListItem)go.GetComponent <EventShopListItem>();

            if (UnityEngine.Object.op_Equality((UnityEngine.Object)component, (UnityEngine.Object)null))
            {
                return;
            }
            GlobalVars.EventShopItem = component.EventShopInfo;
            GlobalVars.ShopType      = EShopType.Event;
            Network.RequestAPI((WebAPI) new ReqGetCoinNum(new Network.ResponseCallback(this.ResponseCallback)), false);
        }
Exemplo n.º 3
0
 public void AddEventShopList(JSON_ShopListArray.Shops[] shops)
 {
     for (int index = 0; index < shops.Length; ++index)
     {
         GameObject        gameObject = (GameObject)Object.Instantiate <GameObject>((M0)this.ItemTemplate);
         EventShopListItem component  = (EventShopListItem)gameObject.GetComponent <EventShopListItem>();
         component.SetShopList(shops[index]);
         gameObject.get_transform().SetParent(((Component)this).get_transform());
         gameObject.get_transform().set_localScale(this.ItemTemplate.get_transform().get_localScale());
         ((ListItemEvents)gameObject.GetComponent <ListItemEvents>()).OnSelect = new ListItemEvents.ListItemEvent(this.OnSelectItem);
         gameObject.SetActive(true);
         GlobalVars.EventShopListItems.Add(component);
     }
 }
Exemplo n.º 4
0
 public void AddEventShopList(JSON_ShopListArray.Shops[] shops)
 {
     for (int index = 0; index < shops.Length; ++index)
     {
         Json_ShopMsgResponse msg = EventShopList.ParseMsg(shops[index]);
         if (msg != null && msg.hide == 0)
         {
             GameObject        gameObject = (GameObject)UnityEngine.Object.Instantiate <GameObject>((M0)this.ItemTemplate);
             EventShopListItem component  = (EventShopListItem)gameObject.GetComponent <EventShopListItem>();
             component.SetShopList(shops[index], msg);
             gameObject.get_transform().SetParent(((Component)this).get_transform());
             gameObject.get_transform().set_localScale(this.ItemTemplate.get_transform().get_localScale());
             ((ListItemEvents)gameObject.GetComponent <ListItemEvents>()).OnSelect = new ListItemEvents.ListItemEvent(this.OnSelectItem);
             gameObject.SetActive(true);
             GlobalVars.EventShopListItems.Add(component);
         }
     }
 }
Exemplo n.º 5
0
        private void OnSelectItem(GameObject go)
        {
            EventShopListItem component = (EventShopListItem)go.GetComponent <EventShopListItem>();

            if (Object.op_Equality((Object)component, (Object)null))
            {
                return;
            }
            GlobalVars.EventShopItem = component;
            GlobalVars.ShopType      = EShopType.Event;
            if (GlobalVars.EventShopItem.btn_update)
            {
                FlowNode_GameObject.ActivateOutputLinks((Component)this, 101);
            }
            else
            {
                FlowNode_GameObject.ActivateOutputLinks((Component)this, 102);
            }
        }