Пример #1
0
 public void Init(GameObject spaceShip, GameObject uiCamera, GachaType type, GachaMainPageContext.GachaAmountType amountType, Action endCallBack = null)
 {
     this._spaceShip     = spaceShip;
     this._uiCamera      = uiCamera;
     this._type          = type;
     this._endCallBack   = endCallBack;
     this._amountType    = amountType;
     this._mainMenuStage = (spaceShip != null) ? spaceShip.GetComponent <MainMenuStage>() : null;
 }
Пример #2
0
 public void Start(GachaType gacha, GachaMainPageContext.GachaAmountType amount, Action <GachaType, GachaMainPageContext.GachaAmountType> callback)
 {
     if (!this._waiting)
     {
         this._waiting    = true;
         this._gachaType  = gacha;
         this._amountType = amount;
         this._callback   = callback;
         this.ShowWheel();
     }
 }
Пример #3
0
        private void TriggerStageGachaBox(GachaType type, GachaAmountType gachaAmountType)
        {
            base.view.transform.Find("BlockPanel").gameObject.SetActive(true);
            Singleton <MainUIManager> .Instance.SceneCanvas.gameObject.SetActive(false);

            MonoStageGacha component    = UnityEngine.Object.Instantiate <GameObject>(Miscs.LoadResource <GameObject>("Entities/DynamicObject/StageGacha3D", BundleType.RESOURCE_FILE)).GetComponent <MonoStageGacha>();
            GameObject     uiCamera     = GameObject.Find("UICamera");
            GameObject     spaceShipObj = Singleton <MainUIManager> .Instance.GetMainCanvas().GetSpaceShipObj();

            SuperDebug.VeryImportantAssert(spaceShipObj != null, new Func <string>(this.SpaceshipNullAssertFailedCallback));
            component.Init(spaceShipObj, uiCamera, type, gachaAmountType, new Action(this.BeginDropAnimationAfterBoxAnimation));
        }
Пример #4
0
        private void OnHcoinTenGachaBtnClick()
        {
            this._currentGachaType = 2;
            int ticketID = (int)this._displayInfo.hcoinGachaData.get_ticket_material_id();

            if (this.TicketConditionCheck(ticketID, 10))
            {
                this._waitGachaRsp.Start(this._currentGachaType, GachaAmountType.GachaTen, new Action <GachaType, GachaAmountType>(this.TriggerStageGachaBox));
                Singleton <NetworkManager> .Instance.RequestGacha(this._currentGachaType, 10);

                this._cost = 10;
            }
        }
Пример #5
0
        private void OnFriendOneGachaBtnClick()
        {
            this._currentGachaType = 1;
            int needFriendPoint = (int)this._displayInfo.friendPointGachaData.get_friends_point_cost();

            if (this.FriendConditionCheck(needFriendPoint))
            {
                this._waitGachaRsp.Start(this._currentGachaType, GachaAmountType.GachaOne, new Action <GachaType, GachaAmountType>(this.TriggerStageGachaBox));
                Singleton <NetworkManager> .Instance.RequestGacha(this._currentGachaType, 1);

                this._cost = needFriendPoint;
            }
        }
Пример #6
0
        private void OnFriendTenGachaBtnClick()
        {
            int num;

            this._currentGachaType = 1;
            int maxFriendPointGachaTime = this.GetMaxFriendPointGachaTime(out num);

            if (this.FriendConditionCheck(num))
            {
                this._waitGachaRsp.Start(this._currentGachaType, GachaAmountType.GachaTen, new Action <GachaType, GachaAmountType>(this.TriggerStageGachaBox));
                Singleton <NetworkManager> .Instance.RequestGacha(this._currentGachaType, maxFriendPointGachaTime);

                this._cost = num;
            }
        }
Пример #7
0
        private void OnSpecialTenGachaBtnClick()
        {
            this._currentGachaType = 3;
            if ((this._displayInfo.specialGachaData != null) && (TimeUtil.Now < Miscs.GetDateTimeFromTimeStamp(this._displayInfo.specialGachaData.get_data_expire_time())))
            {
                int ticketID = (int)this._displayInfo.specialGachaData.get_ticket_material_id();
                if (this.TicketConditionCheck(ticketID, 10))
                {
                    this._waitGachaRsp.Start(this._currentGachaType, GachaAmountType.GachaTen, new Action <GachaType, GachaAmountType>(this.TriggerStageGachaBox));
                    Singleton <NetworkManager> .Instance.RequestGacha(this._currentGachaType, 10);

                    this._cost = 10;
                }
            }
            else
            {
                Singleton <MainUIManager> .Instance.ShowDialog(new GeneralHintDialogContext(LocalizationGeneralLogic.GetText("Menu_Desc_SpecialGachaTimeoutHint", new object[0]), 2f), UIType.Any);

                Singleton <NetworkManager> .Instance.RequestGachaDisplayInfo();
            }
        }
Пример #8
0
        public GachaResultPageContext(GachaDisplayInfo displayInfo, GachaType type, List <StorageDataItemBase> itemList, List <GachaItem> gachaItemList, int cost)
        {
            ContextPattern pattern = new ContextPattern {
                contextName    = "GachaResultPageContext",
                viewPrefabPath = "UI/Menus/Page/Gacha/GachaResultPage",
                cacheType      = ViewCacheType.AlwaysCached
            };

            base.config        = pattern;
            this._type         = type;
            this._itemList     = itemList;
            this._rareItemList = new HashSet <int>();
            foreach (GachaItem item in gachaItemList)
            {
                if (item.get_is_rare_dropSpecified() && item.get_is_rare_drop())
                {
                    this._rareItemList.Add((int)item.get_item_id());
                }
            }
            this._cost        = cost;
            this._displayInfo = displayInfo;
        }