Example #1
0
        private void Start()
        {
            GameManager instance = MonoSingleton <GameManager> .Instance;

            Json_LoginBonus[] jsonLoginBonusArray = instance.Player.LoginBonus;
            this.mLoginBonusCount = instance.Player.LoginBonusCount;
            if (this.DebugItems != null && this.DebugItems.Length > 0)
            {
                jsonLoginBonusArray   = this.DebugItems;
                this.mLoginBonusCount = this.DebugBonusCount;
            }
            if (jsonLoginBonusArray != null && Object.op_Inequality((Object)this.Item_Normal, (Object)null) && Object.op_Inequality((Object)this.ItemList, (Object)null))
            {
                Transform transform = this.ItemList.get_transform();
                for (int index = 0; index < jsonLoginBonusArray.Length; ++index)
                {
                    // ISSUE: object of a compiler-generated type is created
                    // ISSUE: variable of a compiler-generated type
                    LoginBonusCustomWindow.\u003CStart\u003Ec__AnonStorey358 startCAnonStorey358 = new LoginBonusCustomWindow.\u003CStart\u003Ec__AnonStorey358();
                    // ISSUE: reference to a compiler-generated field
                    startCAnonStorey358.\u003C\u003Ef__this = this;
                    string key = jsonLoginBonusArray[index].iname;
                    int    num = jsonLoginBonusArray[index].num;
                    if (string.IsNullOrEmpty(key) && jsonLoginBonusArray[index].coin > 0)
                    {
                        key = "$COIN";
                        num = jsonLoginBonusArray[index].coin;
                    }
                    if (!string.IsNullOrEmpty(key))
                    {
                        ItemParam itemParam = instance.GetItemParam(key);
                        if (itemParam != null)
                        {
                            LoginBonusData loginBonusData = new LoginBonusData();
                            loginBonusData.DayNum = index + 1;
                            if (loginBonusData.Setup(0L, itemParam, num))
                            {
                                ListItemEvents listItemEvents = index >= this.mLoginBonusCount - 1 ? this.Item_Normal : this.Item_Taken;
                                // ISSUE: reference to a compiler-generated field
                                startCAnonStorey358.item = (ListItemEvents)Object.Instantiate <ListItemEvents>((M0)listItemEvents);
                                // ISSUE: reference to a compiler-generated field
                                DataSource.Bind <ItemData>(((Component)startCAnonStorey358.item).get_gameObject(), (ItemData)loginBonusData);
                                if (Object.op_Equality((Object)listItemEvents, (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());
                                    }
                                    // ISSUE: reference to a compiler-generated field
                                    ((Component)loginBonusVipBadge).get_transform().SetParent(((Component)startCAnonStorey358.item).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)
                                {
                                    // ISSUE: reference to a compiler-generated field
                                    ((Transform)this.TodayBadge).SetParent(((Component)startCAnonStorey358.item).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)
                                {
                                    // ISSUE: reference to a compiler-generated field
                                    ((Transform)this.TommorowBadge).SetParent(((Component)startCAnonStorey358.item).get_transform(), false);
                                    this.TommorowBadge.set_anchoredPosition(Vector2.get_zero());
                                    ((Component)this.TommorowBadge).get_gameObject().SetActive(true);
                                }
                                if (index < this.mLoginBonusCount - 1)
                                {
                                    // ISSUE: reference to a compiler-generated field
                                    Transform child = ((Component)startCAnonStorey358.item).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);
                                        }
                                    }
                                }
                                // ISSUE: reference to a compiler-generated field
                                Button component1 = (Button)((Component)((Component)startCAnonStorey358.item).get_transform()).GetComponent <Button>();
                                if (Object.op_Inequality((Object)component1, (Object)null))
                                {
                                    // ISSUE: method pointer
                                    ((UnityEvent)component1.get_onClick()).AddListener(new UnityAction((object)startCAnonStorey358, __methodptr(\u003C\u003Em__359)));
                                }
                                // ISSUE: reference to a compiler-generated field
                                ((Component)startCAnonStorey358.item).get_transform().SetParent(transform, false);
                                // ISSUE: reference to a compiler-generated field
                                ((Component)startCAnonStorey358.item).get_gameObject().SetActive(true);
                                // ISSUE: reference to a compiler-generated field
                                this.mItems.Add(startCAnonStorey358.item);
                            }
                        }
                    }
                }
            }
            this.FlipTodaysItem();
            this.StartCoroutine(this.WaitLoadAsync());
        }
Example #2
0
        private void Start()
        {
            GameManager instance = MonoSingleton <GameManager> .Instance;

            Json_LoginBonus[] jsonLoginBonusArray = instance.Player.FindLoginBonuses(this.TableID);
            this.mLoginBonusCount = instance.Player.LoginCountWithType(this.TableID);
            ItemData itemData1 = (ItemData)null;
            ItemData itemData2 = (ItemData)null;
            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)
                {
                    string key = jsonLoginBonusArray[index].iname;
                    int    num = jsonLoginBonusArray[index].num;
                    if (string.IsNullOrEmpty(key) && jsonLoginBonusArray[index].coin > 0)
                    {
                        key = "$COIN";
                        num = jsonLoginBonusArray[index].coin;
                    }
                    if (!string.IsNullOrEmpty(key))
                    {
                        ItemParam itemParam = instance.GetItemParam(key);
                        if (itemParam != null)
                        {
                            LoginBonusData loginBonusData = new LoginBonusData();
                            loginBonusData.DayNum = index + 1;
                            if (index == this.mLoginBonusCount - 1)
                            {
                                itemData1 = (ItemData)loginBonusData;
                                if (jsonLoginBonusArray[index].vip != null && jsonLoginBonusArray[index].vip.lv > 0)
                                {
                                    flag1 = true;
                                }
                                if (loginBonusData != null && loginBonusData.Param != null)
                                {
                                    if (loginBonusData.Param.type == EItemType.Ticket)
                                    {
                                        AnalyticsManager.TrackCurrencyObtain(AnalyticsManager.CurrencyType.SummonTicket, AnalyticsManager.CurrencySubType.FREE, (long)loginBonusData.Num, "Login Bonus", new Dictionary <string, object>()
                                        {
                                            {
                                                "ticket_id",
                                                (object)loginBonusData.ItemID
                                            }
                                        });
                                    }
                                    else
                                    {
                                        AnalyticsManager.TrackCurrencyObtain(AnalyticsManager.CurrencyType.Item, AnalyticsManager.CurrencySubType.FREE, (long)loginBonusData.Num, "Login Bonus", new Dictionary <string, object>()
                                        {
                                            {
                                                "item_id",
                                                (object)loginBonusData.ItemID
                                            }
                                        });
                                    }
                                }
                                if (string.IsNullOrEmpty(key) && jsonLoginBonusArray[index].coin > 0)
                                {
                                    AnalyticsManager.TrackCurrencyObtain(AnalyticsManager.CurrencyType.Gem, AnalyticsManager.CurrencySubType.FREE, (long)jsonLoginBonusArray[index].coin, "Login Bonus", (Dictionary <string, object>)null);
                                }
                            }
                            else if (index == this.mLoginBonusCount)
                            {
                                itemData2 = (ItemData)loginBonusData;
                            }
                            if (loginBonusData.Setup(0L, itemParam, num))
                            {
                                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 <ItemData>(((Component)listItemEvents2).get_gameObject(), (ItemData)loginBonusData);
                                    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);
                                    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) && itemData1 != null && itemData1.Param != null)
            {
                this.Today.set_text(this.MakeTodayText(itemData1));
            }
            if (Object.op_Inequality((Object)this.TodayItem, (Object)null))
            {
                DataSource.Bind <ItemData>(this.TodayItem.get_gameObject(), itemData1);
                GameParameter.UpdateAll(this.TodayItem);
            }
            if (Object.op_Inequality((Object)this.TommorowItem, (Object)null))
            {
                DataSource.Bind <ItemData>(this.TommorowItem.get_gameObject(), itemData2);
                GameParameter.UpdateAll(this.TommorowItem);
            }
            if (Object.op_Inequality((Object)this.Tommorow, (Object)null) && !flag2 && (itemData2 != null && itemData2.Param != null))
            {
                this.Tommorow.set_text(this.MakeTomorrowText(itemData1, itemData2));
            }
            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());
        }
Example #3
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());
        }