Beispiel #1
0
 private void OnDestroy()
 {
     if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.mCurrentPreview, (UnityEngine.Object)null))
     {
         GameUtility.DestroyGameObject((Component)this.mCurrentPreview);
         this.mCurrentPreview = (UnitPreview)null;
     }
     GameUtility.DestroyGameObjects <UnitPreview>(this.mPreviewControllers);
     if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.mLeaderSkillDetail, (UnityEngine.Object)null))
     {
         UnityEngine.Object.Destroy((UnityEngine.Object) this.mLeaderSkillDetail.get_gameObject());
     }
     GameUtility.DestroyGameObjects(this.mAbilits);
 }
 private void OnDestroy()
 {
     GameUtility.DestroyGameObject((Component)this.mCurrentPreview);
     this.mCurrentPreview = (UnitPreview)null;
     if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.mPreviewUnitRT, (UnityEngine.Object)null))
     {
         RenderTexture.ReleaseTemporary(this.mPreviewUnitRT);
         this.mPreviewUnitRT = (RenderTexture)null;
     }
     if (!UnityEngine.Object.op_Inequality((UnityEngine.Object) this.mMessageWindow, (UnityEngine.Object)null))
     {
         return;
     }
     UnityEngine.Object.Destroy((UnityEngine.Object)((Component)this.mMessageWindow).get_gameObject());
     this.mMessageWindow = (LoginBonusWindow)null;
 }
Beispiel #3
0
        private void ReloadPreviewModels()
        {
            UnitData dataOfClass = DataSource.FindDataOfClass <UnitData>(((Component)this).get_gameObject(), (UnitData)null);

            if (dataOfClass == null || UnityEngine.Object.op_Equality((UnityEngine.Object) this.mPreviewParent, (UnityEngine.Object)null))
            {
                return;
            }
            GameUtility.DestroyGameObjects <UnitPreview>(this.mPreviewControllers);
            this.mPreviewControllers.Clear();
            this.mCurrentPreview = (UnitPreview)null;
            for (int index = 0; index < dataOfClass.Jobs.Length; ++index)
            {
                UnitPreview unitPreview = (UnitPreview)null;
                if (dataOfClass.Jobs[index] != null && dataOfClass.Jobs[index].Param != null)
                {
                    GameObject gameObject = new GameObject("Preview", new System.Type[1]
                    {
                        typeof(UnitPreview)
                    });
                    unitPreview = (UnitPreview)gameObject.GetComponent <UnitPreview>();
                    unitPreview.DefaultLayer = GameUtility.LayerHidden;
                    unitPreview.SetupUnit(dataOfClass.UnitParam.iname, dataOfClass.Jobs[index].JobID);
                    gameObject.get_transform().SetParent(this.mPreviewParent, false);
                    if (index == dataOfClass.JobIndex)
                    {
                        this.mCurrentPreview = unitPreview;
                    }
                }
                this.mPreviewControllers.Add(unitPreview);
            }
            if (!UnityEngine.Object.op_Implicit((UnityEngine.Object) this.mCurrentPreview))
            {
                return;
            }
            GameObject gameObject1 = new GameObject("Preview", new System.Type[1]
            {
                typeof(UnitPreview)
            });

            this.mCurrentPreview = (UnitPreview)gameObject1.GetComponent <UnitPreview>();
            this.mCurrentPreview.DefaultLayer = GameUtility.LayerHidden;
            this.mCurrentPreview.SetupUnit(dataOfClass, -1);
            gameObject1.get_transform().SetParent(this.mPreviewParent, false);
            this.mPreviewControllers.Add(this.mCurrentPreview);
        }
Beispiel #4
0
        private void ReloadPreviewModels()
        {
            if (this.mCurrentUnit == null || UnityEngine.Object.op_Equality((UnityEngine.Object) this.mPreviewParent, (UnityEngine.Object)null))
            {
                return;
            }
            GameUtility.DestroyGameObjects <UnitPreview>(this.mPreviewControllers);
            this.mPreviewControllers.Clear();
            this.mCurrentPreview = (UnitPreview)null;
            if (UnityEngine.Object.op_Implicit((UnityEngine.Object) this.mCurrentPreview))
            {
                return;
            }
            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.mPreviewParent, false);
            this.mPreviewControllers.Add(this.mCurrentPreview);
        }
        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);
            }
            ItemData data1 = (ItemData)null;
            ItemData data2 = (ItemData)null;
            ItemData data3 = (ItemData)null;

            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)
                {
                    string key  = jsonLoginBonusArray[index1].iname;
                    int    num1 = jsonLoginBonusArray[index1].num;
                    if (string.IsNullOrEmpty(key) && jsonLoginBonusArray[index1].coin > 0)
                    {
                        key  = "$COIN";
                        num1 = jsonLoginBonusArray[index1].coin;
                    }
                    if (!string.IsNullOrEmpty(key))
                    {
                        ItemParam itemParam = instance.GetItemParam(key);
                        if (itemParam != null)
                        {
                            LoginBonusData loginBonusData = new LoginBonusData();
                            loginBonusData.DayNum = index1 + 1;
                            if (index1 == this.mLoginBonusCount - 1)
                            {
                                data2 = (ItemData)loginBonusData;
                                if (loginBonusData != null && loginBonusData.Param != null)
                                {
                                    if (loginBonusData.ItemType == EItemType.Ticket)
                                    {
                                        AnalyticsManager.TrackNonPremiumCurrencyObtain(AnalyticsManager.NonPremiumCurrencyType.SummonTicket, (long)loginBonusData.Num, "Login Bonus", loginBonusData.ItemID);
                                    }
                                    else
                                    {
                                        AnalyticsManager.TrackNonPremiumCurrencyObtain(AnalyticsManager.NonPremiumCurrencyType.Item, (long)loginBonusData.Num, "Login Bonus", loginBonusData.ItemID);
                                    }
                                }
                                if (string.IsNullOrEmpty(key) && jsonLoginBonusArray[index1].coin > 0)
                                {
                                    AnalyticsManager.TrackFreePremiumCurrencyObtain((long)jsonLoginBonusArray[index1].coin, "Login Bonus");
                                }
                            }
                            else if (index1 == this.mLoginBonusCount)
                            {
                                data3 = (ItemData)loginBonusData;
                            }
                            if (loginBonusData.Setup(0L, itemParam, num1))
                            {
                                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 <ItemData>(((Component)listItemEvents).get_gameObject(), (ItemData)loginBonusData);
                                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);
                                this.mItems.Add(listItemEvents);
                            }
                        }
                    }
                }
                data1 = DataSource.FindDataOfClass <ItemData>(((Component)this.mItems[this.mItems.Count - 1]).get_gameObject(), (ItemData)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 <ItemData>(this.TodayItem.get_gameObject(), data2);
                GameParameter.UpdateAll(this.TodayItem);
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.TommorowItem, (UnityEngine.Object)null))
            {
                DataSource.Bind <ItemData>(this.TommorowItem.get_gameObject(), data3);
                GameParameter.UpdateAll(this.TommorowItem);
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.LastItem, (UnityEngine.Object)null))
            {
                DataSource.Bind <ItemData>(this.LastItem, data1);
                GameParameter.UpdateAll(this.LastItem);
            }
            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__AnonStorey344 startCAnonStorey344 = new LoginBonusWindow28days.\u003CStart\u003Ec__AnonStorey344();
                    // ISSUE: reference to a compiler-generated field
                    startCAnonStorey344.\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
                    startCAnonStorey344.index = index1;
                    this.WeakToggle[index1].set_isOn(index1 == this.mCurrentWeak);
                    // ISSUE: method pointer
                    ((UnityEvent <bool>) this.WeakToggle[index1].onValueChanged).AddListener(new UnityAction <bool>((object)startCAnonStorey344, __methodptr(\u003C\u003Em__39B)));
                }
            }
            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);
                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());
        }