Exemple #1
0
        private RewardData GiftDataToRewardData(GiftData[] giftDatas)
        {
            RewardData rewardData = new RewardData();

            rewardData.Exp        = 0;
            rewardData.Stamina    = 0;
            rewardData.MultiCoin  = 0;
            rewardData.KakeraCoin = 0;
            GameManager instance = MonoSingleton <GameManager> .Instance;

            for (int index = 0; index < giftDatas.Length; ++index)
            {
                GiftData giftData = giftDatas[index];
                rewardData.Coin       += giftData.coin;
                rewardData.Gold       += giftData.gold;
                rewardData.ArenaMedal += giftData.arenacoin;
                rewardData.MultiCoin  += giftData.multicoin;
                rewardData.KakeraCoin += giftData.kakeracoin;
                if (giftData.iname != null)
                {
                    if (giftData.CheckGiftTypeIncluded(GiftTypes.Artifact))
                    {
                        ArtifactParam artifactParam = MonoSingleton <GameManager> .Instance.MasterParam.GetArtifactParam(giftData.iname);

                        if (artifactParam != null)
                        {
                            if (rewardData.GiftRecieveItemDataDic.ContainsKey(giftData.iname))
                            {
                                rewardData.GiftRecieveItemDataDic[giftData.iname].num += giftData.num;
                            }
                            else
                            {
                                GiftRecieveItemData giftRecieveItemData = new GiftRecieveItemData();
                                giftRecieveItemData.Set(giftData.iname, GiftTypes.Artifact, artifactParam.rareini, giftData.num);
                                rewardData.GiftRecieveItemDataDic.Add(giftData.iname, giftRecieveItemData);
                            }
                        }
                    }
                    else
                    {
                        ItemData itemData = new ItemData();
                        if (itemData.Setup(0L, giftData.iname, giftData.num))
                        {
                            rewardData.Items.Add(itemData);
                            ItemData itemDataByItemId = instance.Player.FindItemDataByItemID(itemData.Param.iname);
                            int      num = itemDataByItemId == null ? 0 : itemDataByItemId.Num;
                            rewardData.ItemsBeforeAmount.Add(num);
                        }
                    }
                }
            }
            return(rewardData);
        }
Exemple #2
0
 private void AddReward(string iname, GiftTypes giftTipe, int rarity, int num)
 {
     if (this.GiftRecieveItemDataDic.ContainsKey(iname))
     {
         this.GiftRecieveItemDataDic[iname].num += num;
     }
     else
     {
         GiftRecieveItemData giftRecieveItemData = new GiftRecieveItemData();
         giftRecieveItemData.Set(iname, giftTipe, rarity, num);
         this.GiftRecieveItemDataDic.Add(iname, giftRecieveItemData);
     }
 }
Exemple #3
0
        private void Start()
        {
            GameManager instance = MonoSingleton <GameManager> .Instance;

            Json_LoginBonus[] jsonLoginBonusArray;
            if (this.IsConfigWindow)
            {
                jsonLoginBonusArray   = instance.Player.LoginBonus28days.bonuses;
                this.mLoginBonusCount = instance.Player.LoginBonus28days.count;
                this.mNotifyUnits     = instance.Player.LoginBonus28days.bonus_units;
            }
            else
            {
                jsonLoginBonusArray   = instance.Player.FindLoginBonuses(this.TableID);
                this.mLoginBonusCount = instance.Player.LoginCountWithType(this.TableID);
                this.mNotifyUnits     = instance.Player.GetLoginBonuseUnitIDs(this.TableID);
            }
            GiftRecieveItemData        data1 = (GiftRecieveItemData)null;
            GiftRecieveItemData        data2 = (GiftRecieveItemData)null;
            GiftRecieveItemData        data3 = (GiftRecieveItemData)null;
            List <GiftRecieveItemData> giftRecieveItemDataList = new List <GiftRecieveItemData>();

            if (this.DebugItems != null && this.DebugItems.Length > 0)
            {
                jsonLoginBonusArray   = this.DebugItems;
                this.mLoginBonusCount = this.DebugBonusCount;
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.RemainingCount, (UnityEngine.Object)null))
            {
                this.RemainingCount.set_text(Math.Max(28 - this.mLoginBonusCount, 0).ToString());
            }
            this.mCurrentWeak = Math.Max(this.mLoginBonusCount - 1, 0) / 7;
            if (jsonLoginBonusArray != null && UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Item_Normal, (UnityEngine.Object)null) && UnityEngine.Object.op_Inequality((UnityEngine.Object) this.ItemList, (UnityEngine.Object)null))
            {
                for (int index1 = 0; index1 < jsonLoginBonusArray.Length; ++index1)
                {
                    GiftRecieveItemData data4 = new GiftRecieveItemData();
                    giftRecieveItemDataList.Add(data4);
                    string str  = jsonLoginBonusArray[index1].iname;
                    int    num1 = jsonLoginBonusArray[index1].num;
                    if (string.IsNullOrEmpty(str) && jsonLoginBonusArray[index1].coin > 0)
                    {
                        str  = "$COIN";
                        num1 = jsonLoginBonusArray[index1].coin;
                    }
                    if (!string.IsNullOrEmpty(str))
                    {
                        ItemParam itemParam = instance.MasterParam.GetItemParam(str, false);
                        if (itemParam != null)
                        {
                            data4.Set(str, GiftTypes.Item, itemParam.rare, num1);
                            data4.name = itemParam.name;
                        }
                        ConceptCardParam conceptCardParam = instance.MasterParam.GetConceptCardParam(str);
                        if (conceptCardParam != null)
                        {
                            data4.Set(str, GiftTypes.ConceptCard, conceptCardParam.rare, num1);
                            data4.name = conceptCardParam.name;
                        }
                        if (itemParam == null && conceptCardParam == null)
                        {
                            DebugUtility.LogError(string.Format("不明な識別子が報酬として設定されています。itemID => {0}", (object)str));
                        }
                        int            num2           = this.mLoginBonusCount - (!this.IsConfigWindow ? 1 : 0);
                        ListItemEvents listItemEvents = (ListItemEvents)UnityEngine.Object.Instantiate <ListItemEvents>(index1 >= num2 ? (M0)this.Item_Normal : (M0)this.Item_Taken);
                        listItemEvents.OnSelect = new ListItemEvents.ListItemEvent(this.OnItemSelect);
                        DataSource.Bind <GiftRecieveItemData>(((Component)listItemEvents).get_gameObject(), data4);
                        if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.TodayBadge, (UnityEngine.Object)null) && index1 == this.mLoginBonusCount - 1)
                        {
                            ((Transform)this.TodayBadge).SetParent(((Component)listItemEvents).get_transform(), false);
                            this.TodayBadge.set_anchoredPosition(Vector2.get_zero());
                            ((Component)this.TodayBadge).get_gameObject().SetActive(true);
                        }
                        else if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.TommorowBadge, (UnityEngine.Object)null) && index1 == this.mLoginBonusCount)
                        {
                            ((Transform)this.TommorowBadge).SetParent(((Component)listItemEvents).get_transform(), false);
                            this.TommorowBadge.set_anchoredPosition(Vector2.get_zero());
                            ((Component)this.TommorowBadge).get_gameObject().SetActive(true);
                        }
                        if (index1 < this.mLoginBonusCount - 1)
                        {
                            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(false);
                                }
                            }
                        }
                        Transform transform = this.ItemList.get_transform();
                        int       index2    = index1 % 7;
                        if (this.PositionList != null && this.PositionList.Length > index2 && UnityEngine.Object.op_Inequality((UnityEngine.Object) this.PositionList[index2], (UnityEngine.Object)null))
                        {
                            transform = this.PositionList[index2].get_transform();
                        }
                        if (index1 == 0)
                        {
                            this.DisableFirstDayHiddenOject(((Component)listItemEvents).get_gameObject());
                        }
                        int num3 = index1 / 7;
                        ((Component)listItemEvents).get_transform().SetParent(transform, false);
                        ((Component)listItemEvents).get_gameObject().SetActive(num3 == this.mCurrentWeak);
                        if (num3 == this.mCurrentWeak)
                        {
                            ((GiftRecieveItem)((Component)listItemEvents).GetComponentInChildren <GiftRecieveItem>()).UpdateValue();
                        }
                        this.mItems.Add(listItemEvents);
                    }
                }
                int index            = this.mLoginBonusCount - 1;
                int mLoginBonusCount = this.mLoginBonusCount;
                if (index >= 0 && index < jsonLoginBonusArray.Length)
                {
                    data2 = giftRecieveItemDataList[index];
                }
                if (mLoginBonusCount >= 0 && mLoginBonusCount < jsonLoginBonusArray.Length)
                {
                    data3 = giftRecieveItemDataList[mLoginBonusCount];
                }
                data1 = DataSource.FindDataOfClass <GiftRecieveItemData>(((Component)this.mItems[this.mItems.Count - 1]).get_gameObject(), (GiftRecieveItemData)null);
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.PopupMessage, (UnityEngine.Object)null))
            {
                this.PopupMessage.set_text(this.GetPopupMessage(data2));
            }
            bool flag = instance.Player.IsLastLoginBonus(this.TableID);

            if (jsonLoginBonusArray != null && this.mLoginBonusCount == jsonLoginBonusArray.Length)
            {
                flag = true;
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.RemainingCounter, (UnityEngine.Object)null))
            {
                this.RemainingCounter.SetActive(!flag);
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.TodayItem, (UnityEngine.Object)null))
            {
                DataSource.Bind <GiftRecieveItemData>(this.TodayItem.get_gameObject(), data2);
                ((GiftRecieveItem)this.TodayItem.get_gameObject().GetComponentInChildren <GiftRecieveItem>()).UpdateValue();
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.TommorowItem, (UnityEngine.Object)null))
            {
                DataSource.Bind <GiftRecieveItemData>(this.TommorowItem.get_gameObject(), data3);
                ((GiftRecieveItem)this.TommorowItem.get_gameObject().GetComponentInChildren <GiftRecieveItem>()).UpdateValue();
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.LastItem, (UnityEngine.Object)null))
            {
                DataSource.Bind <GiftRecieveItemData>(this.LastItem.get_gameObject(), data1);
                ((GiftRecieveItem)this.LastItem.get_gameObject().GetComponentInChildren <GiftRecieveItem>()).UpdateValue();
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.GainLastItemMessage, (UnityEngine.Object)null))
            {
                this.GainLastItemMessage.set_text(this.GetGainLastItemMessage(data1));
            }
            if (flag)
            {
                FlowNode_GameObject.ActivateOutputLinks((Component)this, 12);
            }
            if (this.WeakToggle != null)
            {
                for (int index1 = 0; index1 < this.WeakToggle.Count; ++index1)
                {
                    // ISSUE: object of a compiler-generated type is created
                    // ISSUE: variable of a compiler-generated type
                    LoginBonusWindow28days.\u003CStart\u003Ec__AnonStorey35A startCAnonStorey35A = new LoginBonusWindow28days.\u003CStart\u003Ec__AnonStorey35A();
                    // ISSUE: reference to a compiler-generated field
                    startCAnonStorey35A.\u003C\u003Ef__this = this;
                    int index2 = index1 * 7 + 6;
                    if (index2 < this.mItems.Count)
                    {
                        ItemData dataOfClass = DataSource.FindDataOfClass <ItemData>(((Component)this.mItems[index2]).get_gameObject(), (ItemData)null);
                        DataSource.Bind <ItemData>(((Component)this.WeakToggle[index1]).get_gameObject(), dataOfClass);
                    }
                    // ISSUE: reference to a compiler-generated field
                    startCAnonStorey35A.index = index1;
                    this.WeakToggle[index1].set_isOn(index1 == this.mCurrentWeak);
                    // ISSUE: method pointer
                    ((UnityEvent <bool>) this.WeakToggle[index1].onValueChanged).AddListener(new UnityAction <bool>((object)startCAnonStorey35A, __methodptr(\u003C\u003Em__35B)));
                }
            }
            string unit_iname = (string)null;

            if (this.mNotifyUnits != null && this.mNotifyUnits.Length > 0)
            {
                unit_iname = this.mNotifyUnits[new Random().Next() % this.mNotifyUnits.Length];
            }
            if (!string.IsNullOrEmpty(this.DebugNotifyUnitID))
            {
                unit_iname = this.DebugNotifyUnitID;
            }
            if (!string.IsNullOrEmpty(unit_iname))
            {
                this.mCurrentUnit = new UnitData();
                this.mCurrentUnit.Setup(unit_iname, 0, 0, 0, (string)null, 1, EElement.None, 0);
                GameObject gameObject = new GameObject("Preview", new System.Type[1]
                {
                    typeof(UnitPreview)
                });
                this.mCurrentPreview = (UnitPreview)gameObject.GetComponent <UnitPreview>();
                this.mCurrentPreview.DefaultLayer = GameUtility.LayerHidden;
                this.mCurrentPreview.SetupUnit(this.mCurrentUnit, -1);
                gameObject.get_transform().SetParent(this.PreviewParent, false);
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.PreviewCamera, (UnityEngine.Object)null) && UnityEngine.Object.op_Inequality((UnityEngine.Object) this.PreviewImage, (UnityEngine.Object)null))
                {
                    int num = Mathf.FloorToInt((float)Screen.get_height() * 0.8f);
                    this.mPreviewUnitRT = RenderTexture.GetTemporary(num, num, 16, (RenderTextureFormat)7);
                    this.PreviewCamera.set_targetTexture(this.mPreviewUnitRT);
                    this.PreviewImage.set_texture((Texture)this.mPreviewUnitRT);
                }
                GameUtility.SetLayer((Component)this.mCurrentPreview, GameUtility.LayerCH, true);
            }
            this.StartCoroutine(this.WaitLoadAsync());
        }
Exemple #4
0
        private void Start()
        {
            GameManager instance = MonoSingleton <GameManager> .Instance;

            Json_LoginBonus[] jsonLoginBonusArray = instance.Player.FindLoginBonuses(this.TableID);
            this.mLoginBonusCount = instance.Player.LoginCountWithType(this.TableID);
            GiftRecieveItemData        giftRecieveItemData1    = (GiftRecieveItemData)null;
            GiftRecieveItemData        giftRecieveItemData2    = (GiftRecieveItemData)null;
            List <GiftRecieveItemData> giftRecieveItemDataList = new List <GiftRecieveItemData>();
            bool flag1 = false;

            if (this.DebugItems != null && this.DebugItems.Length > 0)
            {
                jsonLoginBonusArray   = this.DebugItems;
                this.mLoginBonusCount = this.DebugBonusCount;
            }
            if (jsonLoginBonusArray != null)
            {
                for (int index = 0; index < jsonLoginBonusArray.Length; ++index)
                {
                    GiftRecieveItemData data = new GiftRecieveItemData();
                    giftRecieveItemDataList.Add(data);
                    string str = jsonLoginBonusArray[index].iname;
                    int    num = jsonLoginBonusArray[index].num;
                    if (string.IsNullOrEmpty(str) && jsonLoginBonusArray[index].coin > 0)
                    {
                        str = "$COIN";
                        num = jsonLoginBonusArray[index].coin;
                    }
                    if (!string.IsNullOrEmpty(str))
                    {
                        ItemParam itemParam = instance.MasterParam.GetItemParam(str, false);
                        if (itemParam != null)
                        {
                            data.Set(str, GiftTypes.Item, itemParam.rare, num);
                            data.name = itemParam.name;
                        }
                        ConceptCardParam conceptCardParam = instance.MasterParam.GetConceptCardParam(str);
                        if (conceptCardParam != null)
                        {
                            data.Set(str, GiftTypes.ConceptCard, conceptCardParam.rare, num);
                            data.name = conceptCardParam.name;
                        }
                        if (itemParam == null && conceptCardParam == null)
                        {
                            DebugUtility.LogError(string.Format("不明な識別子が報酬として設定されています。itemID => {0}", (object)str));
                        }
                        if (index == this.mLoginBonusCount - 1)
                        {
                            giftRecieveItemData1 = data;
                            if (jsonLoginBonusArray[index].vip != null && jsonLoginBonusArray[index].vip.lv > 0)
                            {
                                flag1 = true;
                            }
                        }
                        else if (index == this.mLoginBonusCount)
                        {
                            giftRecieveItemData2 = data;
                        }
                        ListItemEvents listItemEvents1 = index >= this.mLoginBonusCount - 1 ? this.Item_Normal : this.Item_Taken;
                        if (!Object.op_Equality((Object)listItemEvents1, (Object)null) && !Object.op_Equality((Object)this.ItemList, (Object)null))
                        {
                            ListItemEvents listItemEvents2 = (ListItemEvents)Object.Instantiate <ListItemEvents>((M0)listItemEvents1);
                            DataSource.Bind <GiftRecieveItemData>(((Component)listItemEvents2).get_gameObject(), data);
                            if (Object.op_Equality((Object)listItemEvents1, (Object)this.Item_Normal) && Object.op_Inequality((Object)this.VIPBadge, (Object)null) && (jsonLoginBonusArray[index].vip != null && jsonLoginBonusArray[index].vip.lv > 0))
                            {
                                LoginBonusVIPBadge loginBonusVipBadge = (LoginBonusVIPBadge)Object.Instantiate <LoginBonusVIPBadge>((M0)this.VIPBadge);
                                if (Object.op_Inequality((Object)loginBonusVipBadge.VIPRank, (Object)null))
                                {
                                    loginBonusVipBadge.VIPRank.set_text(jsonLoginBonusArray[index].vip.lv.ToString());
                                }
                                ((Component)loginBonusVipBadge).get_transform().SetParent(((Component)listItemEvents2).get_transform(), false);
                                ((RectTransform)((Component)loginBonusVipBadge).get_transform()).set_anchoredPosition(Vector2.get_zero());
                                ((Component)loginBonusVipBadge).get_gameObject().SetActive(true);
                            }
                            if (Object.op_Inequality((Object)this.TodayBadge, (Object)null) && index == this.mLoginBonusCount - 1)
                            {
                                ((Transform)this.TodayBadge).SetParent(((Component)listItemEvents2).get_transform(), false);
                                this.TodayBadge.set_anchoredPosition(Vector2.get_zero());
                                ((Component)this.TodayBadge).get_gameObject().SetActive(true);
                            }
                            else if (Object.op_Inequality((Object)this.TommorowBadge, (Object)null) && index == this.mLoginBonusCount)
                            {
                                ((Transform)this.TommorowBadge).SetParent(((Component)listItemEvents2).get_transform(), false);
                                this.TommorowBadge.set_anchoredPosition(Vector2.get_zero());
                                ((Component)this.TommorowBadge).get_gameObject().SetActive(true);
                            }
                            if (index < this.mLoginBonusCount - 1)
                            {
                                Transform child = ((Component)listItemEvents2).get_transform().FindChild(this.CheckName);
                                if (Object.op_Inequality((Object)child, (Object)null))
                                {
                                    Animator component = (Animator)((Component)child).GetComponent <Animator>();
                                    if (Object.op_Inequality((Object)component, (Object)null))
                                    {
                                        ((Behaviour)component).set_enabled(false);
                                    }
                                }
                            }
                            Transform transform = this.ItemList.get_transform();
                            if (this.PositionList != null && this.PositionList.Length > index && Object.op_Inequality((Object)this.PositionList[index], (Object)null))
                            {
                                transform = this.PositionList[index].get_transform();
                            }
                            if (index == 0)
                            {
                                this.DisableFirstDayHiddenOject(((Component)listItemEvents2).get_gameObject());
                            }
                            ((Component)listItemEvents2).get_transform().SetParent(transform, false);
                            ((Component)listItemEvents2).get_gameObject().SetActive(true);
                            ((GiftRecieveItem)((Component)listItemEvents2).GetComponentInChildren <GiftRecieveItem>()).UpdateValue();
                            this.mItems.Add(listItemEvents2);
                        }
                    }
                }
            }
            bool flag2 = instance.Player.IsLastLoginBonus(this.TableID);

            if (jsonLoginBonusArray != null && this.mLoginBonusCount == jsonLoginBonusArray.Length)
            {
                flag2 = true;
            }
            if (Object.op_Inequality((Object)this.Today, (Object)null) && giftRecieveItemData1 != null)
            {
                this.Today.set_text(this.MakeTodayText(giftRecieveItemData1));
            }
            if (Object.op_Inequality((Object)this.TodayItem, (Object)null))
            {
                DataSource.Bind <GiftRecieveItemData>(this.TodayItem.get_gameObject(), giftRecieveItemData1);
                ((GiftRecieveItem)this.TodayItem.get_gameObject().GetComponentInChildren <GiftRecieveItem>()).UpdateValue();
            }
            if (Object.op_Inequality((Object)this.TommorowItem, (Object)null))
            {
                DataSource.Bind <GiftRecieveItemData>(this.TommorowItem.get_gameObject(), giftRecieveItemData2);
                ((GiftRecieveItem)this.TommorowItem.get_gameObject().GetComponentInChildren <GiftRecieveItem>()).UpdateValue();
            }
            if (Object.op_Inequality((Object)this.Tommorow, (Object)null) && !flag2 && giftRecieveItemData2 != null)
            {
                this.Tommorow.set_text(this.MakeTomorrowText(giftRecieveItemData1, giftRecieveItemData2));
            }
            else if (Object.op_Inequality((Object)this.TommorowRow, (Object)null))
            {
                this.Tommorow.set_text(this.MakeLastText());
            }
            if (Object.op_Inequality((Object)this.VIPBonusRow, (Object)null))
            {
                this.VIPBonusRow.SetActive(flag1);
            }
            if (flag2)
            {
                FlowNode_GameObject.ActivateOutputLinks((Component)this, 12);
            }
            this.StartCoroutine(this.WaitLoadAsync());
        }