Esempio n. 1
0
        private void FlipTodaysItem()
        {
            if (this.mLoginBonusCount <= 0 || this.mItems.Count < this.mLoginBonusCount)
            {
                return;
            }
            int            index = Math.Max(this.mLoginBonusCount - 1, 0);
            ListItemEvents mItem = this.mItems[index];

            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.BonusParticleEffect, (UnityEngine.Object)null))
            {
                UIUtility.SpawnParticle(this.BonusParticleEffect, ((Component)mItem).get_transform() as RectTransform, new Vector2(0.5f, 0.5f));
            }
            GiftRecieveItemData dataOfClass    = DataSource.FindDataOfClass <GiftRecieveItemData>(((Component)mItem).get_gameObject(), (GiftRecieveItemData)null);
            ListItemEvents      listItemEvents = (ListItemEvents)UnityEngine.Object.Instantiate <ListItemEvents>((M0)this.Item_Taken);

            DataSource.Bind <GiftRecieveItemData>(((Component)listItemEvents).get_gameObject(), dataOfClass);
            ((Component)listItemEvents).get_transform().SetParent(((Component)mItem).get_transform().get_parent(), false);
            ((Component)listItemEvents).get_transform().SetSiblingIndex(((Component)mItem).get_transform().GetSiblingIndex());
            listItemEvents.OnSelect = new ListItemEvents.ListItemEvent(this.OnItemSelect);
            GiftRecieveItem componentInChildren = (GiftRecieveItem)((Component)listItemEvents).GetComponentInChildren <GiftRecieveItem>();

            if (UnityEngine.Object.op_Inequality((UnityEngine.Object)componentInChildren, (UnityEngine.Object)null))
            {
                componentInChildren.UpdateValue();
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.TodayBadge, (UnityEngine.Object)null))
            {
                ((Transform)this.TodayBadge).SetParent(((Component)listItemEvents).get_transform(), false);
            }
            UnityEngine.Object.Destroy((UnityEngine.Object)((Component)mItem).get_gameObject());
            ((Component)listItemEvents).get_gameObject().SetActive(true);
            Transform child = ((Component)listItemEvents).get_transform().FindChild(this.CheckName);

            if (UnityEngine.Object.op_Inequality((UnityEngine.Object)child, (UnityEngine.Object)null))
            {
                Animator component = (Animator)((Component)child).GetComponent <Animator>();
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object)component, (UnityEngine.Object)null))
                {
                    ((Behaviour)component).set_enabled(true);
                }
            }
            if (index == 0)
            {
                this.DisableFirstDayHiddenOject(((Component)listItemEvents).get_gameObject());
            }
            this.mItems[index] = listItemEvents;
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Message, (UnityEngine.Object)null))
            {
                this.StartCoroutine(this.DelayPopupMessage());
            }
            else
            {
                FlowNode_GameObject.ActivateOutputLinks((Component)this, 13);
            }
        }
Esempio n. 2
0
 private void RefreshUnits(RewardData reward, Transform itemParent, GameObject template)
 {
     using (Dictionary <string, GiftRecieveItemData> .Enumerator enumerator = reward.GiftRecieveItemDataDic.GetEnumerator())
     {
         while (enumerator.MoveNext())
         {
             KeyValuePair <string, GiftRecieveItemData> current = enumerator.Current;
             if (current.Value.type == GiftTypes.Unit)
             {
                 GameObject gameObject = (GameObject)Object.Instantiate <GameObject>((M0)template);
                 gameObject.get_transform().SetParent(itemParent, false);
                 this.mItems.Add(gameObject);
                 GiftRecieveItem componentInChildren = (GiftRecieveItem)gameObject.GetComponentInChildren <GiftRecieveItem>();
                 DataSource.Bind <GiftRecieveItemData>(gameObject, current.Value);
                 gameObject.SetActive(true);
                 componentInChildren.UpdateValue();
             }
         }
     }
 }
Esempio n. 3
0
        public override void Refresh()
        {
            RewardData dataOfClass = DataSource.FindDataOfClass <RewardData>(((Component)this).get_gameObject(), (RewardData)null);

            GameUtility.DestroyGameObjects(this.mItems);
            this.mItems.Clear();
            if (dataOfClass == null)
            {
                return;
            }
            if (Object.op_Inequality((Object)this.ExpRow, (Object)null))
            {
                Transform parent = !Object.op_Inequality((Object)this.ItemList, (Object)null) ? this.ExpRow.get_transform().get_parent() : this.ItemList.get_transform();
                if (dataOfClass.Exp > 0)
                {
                    this.AddRewardList(this.ExpRow, parent);
                }
            }
            if (Object.op_Inequality((Object)this.GoldRow, (Object)null))
            {
                Transform parent = !Object.op_Inequality((Object)this.ItemList, (Object)null) ? this.GoldRow.get_transform().get_parent() : this.ItemList.get_transform();
                if (dataOfClass.Gold > 0)
                {
                    this.AddRewardList(this.GoldRow, parent);
                }
            }
            if (Object.op_Inequality((Object)this.CoinRow, (Object)null))
            {
                Transform parent = !Object.op_Inequality((Object)this.ItemList, (Object)null) ? this.CoinRow.get_transform().get_parent() : this.ItemList.get_transform();
                if (dataOfClass.Coin > 0)
                {
                    this.AddRewardList(this.CoinRow, parent);
                }
            }
            if (Object.op_Inequality((Object)this.StaminaRow, (Object)null))
            {
                Transform parent = !Object.op_Inequality((Object)this.ItemList, (Object)null) ? this.StaminaRow.get_transform().get_parent() : this.ItemList.get_transform();
                if (dataOfClass.Stamina > 0)
                {
                    this.AddRewardList(this.StaminaRow, parent);
                }
            }
            if (Object.op_Inequality((Object)this.ItemTemplate, (Object)null))
            {
                Transform parent1 = !Object.op_Inequality((Object)this.ItemList, (Object)null) ? this.ItemTemplate.get_transform().get_parent() : this.ItemList.get_transform();
                Transform parent2 = (Transform)null;
                if (Object.op_Inequality((Object)this.EventCoinTemplate, (Object)null))
                {
                    parent2 = !Object.op_Inequality((Object)this.ItemList, (Object)null) ? this.EventCoinTemplate.get_transform().get_parent() : this.ItemList.get_transform();
                }
                for (int index = 0; index < dataOfClass.Items.Count; ++index)
                {
                    ItemData data = dataOfClass.Items[index];
                    DataSource.Bind <ItemData>(data.ItemType != EItemType.Unit || !Object.op_Inequality((Object)this.UnitTemplate, (Object)null) ? (data.ItemType != EItemType.EventCoin || Object.op_Equality((Object)parent2, (Object)null) ? this.AddRewardList(this.ItemTemplate, parent1) : this.AddRewardList(this.EventCoinTemplate, parent2)) : this.AddRewardList(this.UnitTemplate, parent1), data);
                }
            }
            if (Object.op_Inequality((Object)this.ArtifactTemplate, (Object)null))
            {
                Transform parent = !Object.op_Inequality((Object)this.ItemList, (Object)null) ? this.ArtifactTemplate.get_transform().get_parent() : this.ItemList.get_transform();
                using (List <ArtifactRewardData> .Enumerator enumerator = dataOfClass.Artifacts.GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        ArtifactRewardData current = enumerator.Current;
                        DataSource.Bind <ArtifactRewardData>(this.AddRewardList(this.ArtifactTemplate, parent), current);
                    }
                }
            }
            if (Object.op_Inequality((Object)this.ConceptCardTemplate, (Object)null))
            {
                Transform parent = !Object.op_Inequality((Object)this.ItemList, (Object)null) ? this.ConceptCardTemplate.get_transform().get_parent() : this.ItemList.get_transform();
                using (Dictionary <string, GiftRecieveItemData> .Enumerator enumerator = dataOfClass.GiftRecieveItemDataDic.GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        KeyValuePair <string, GiftRecieveItemData> current = enumerator.Current;
                        if (current.Value.type == GiftTypes.ConceptCard)
                        {
                            GameObject      gameObject          = this.AddRewardList(this.ConceptCardTemplate, parent);
                            GiftRecieveItem componentInChildren = (GiftRecieveItem)gameObject.GetComponentInChildren <GiftRecieveItem>();
                            DataSource.Bind <GiftRecieveItemData>(gameObject, current.Value);
                            gameObject.SetActive(true);
                            componentInChildren.UpdateValue();
                        }
                    }
                }
            }
            GameParameter.UpdateAll(((Component)this).get_gameObject());
        }