public void Request(GachaRequestParam _param)
 {
     if (!_param.IsRedrawConfirm)
     {
         if (_param.IsPaid && MonoSingleton <GameManager> .Instance.Player.PaidCoin < _param.Cost)
         {
             this.ActivateOutputLinks(8);
             ((Behaviour)this).set_enabled(false);
             return;
         }
         if (!_param.IsTicketGacha && !_param.IsFree)
         {
             if (_param.CostType == GachaCostType.GOLD)
             {
                 if (MonoSingleton <GameManager> .Instance.Player.Gold < _param.Cost)
                 {
                     this.ActivateOutputLinks(6);
                     ((Behaviour)this).set_enabled(false);
                     return;
                 }
             }
             else if (_param.CostType == GachaCostType.COIN && MonoSingleton <GameManager> .Instance.Player.Coin < _param.Cost)
             {
                 this.ActivateOutputLinks(7);
                 ((Behaviour)this).set_enabled(false);
                 return;
             }
         }
         this.mCurrentGachaType = !_param.IsGold ? GachaTypes.Rare : GachaTypes.Normal;
     }
     this.ExecGacha(_param.Iname, !_param.IsFree ? 0 : 1, !_param.IsTicketGacha ? 0 : _param.Num, 0);
 }
Example #2
0
        private void UpdateCostData()
        {
            if (UnityEngine.Object.op_Equality((UnityEngine.Object) this.m_root.GetComponent <Button>(), (UnityEngine.Object)null))
            {
                return;
            }
            this.m_default.SetActive(false);
            this.m_ticket.SetActive(false);
            GachaRequestParam dataOfClass = DataSource.FindDataOfClass <GachaRequestParam>(this.m_root, (GachaRequestParam)null);

            if (dataOfClass == null)
            {
                return;
            }
            if (dataOfClass.IsTicketGacha)
            {
                ItemData itemDataByItemId = MonoSingleton <GameManager> .Instance.Player.FindItemDataByItemID(dataOfClass.Ticket);

                if (itemDataByItemId == null)
                {
                    return;
                }
                DataSource.Bind <ItemData>(this.m_ticket, itemDataByItemId);
                this.m_ticket.SetActive(true);
                GameParameter.UpdateAll(this.m_ticket);
            }
            else
            {
                ((ImageArray)this.m_default_bg.GetComponent <ImageArray>()).ImageIndex = !dataOfClass.IsGold ? 1 : 0;
                this.RefreshCostNum(this.m_default_bg, dataOfClass.Cost);
                this.m_default.SetActive(true);
            }
        }
 public void OnExecGachaDecision(GachaRequestParam _rparam)
 {
     if (_rparam == null)
     {
         this.Failure();
     }
     this.API = FlowNode_ExecGacha2.ExecType.DECISION;
     this.ExecGacha(_rparam.Iname, !_rparam.IsFree ? 0 : 1, !_rparam.IsTicketGacha ? 0 : _rparam.Num, 1);
 }
 public void OnExecGacha(GachaRequestParam _rparam)
 {
     if (_rparam == null)
     {
         this.Failure();
     }
     this.mUseOneMore = _rparam.IsUseOneMore;
     this.API         = FlowNode_ExecGacha2.ExecType.DEFAULT;
     this.Request(_rparam);
 }
Example #5
0
        private void ExecGacha(string _gname)
        {
            FlowNode_ExecGacha2 component = (FlowNode_ExecGacha2)((Component)this).GetComponent <FlowNode_ExecGacha2>();

            if (!Object.op_Inequality((Object)component, (Object)null))
            {
                return;
            }
            GachaRequestParam _rparam = new GachaRequestParam(_gname);

            if (_rparam == null)
            {
                return;
            }
            component.OnExecGachaDecision(_rparam);
        }
Example #6
0
 public void Set(GachaRequestParam _param)
 {
     this.m_request = _param;
 }
        private void Initalize()
        {
            if (this.IsInialize)
            {
                this.RefreshIcons(true);
                if (this.IsFinishedBonus)
                {
                    return;
                }
                ButtonEvent.Lock("gacha_initialize");
                FlowNode_GameObject.ActivateOutputLinks((Component)this, 60);
            }
            else
            {
                if (GachaResultData.drops == null)
                {
                    return;
                }
                if (GachaResultData.IsRedrawGacha)
                {
                    GlobalEvent.Invoke("DISABLE_HOME_BUTTON", (object)this);
                }
                this.mRequest = (GachaRequestParam)null;
                GachaRequestParam dataOfClass = DataSource.FindDataOfClass <GachaRequestParam>(((Component)this).get_gameObject(), (GachaRequestParam)null);
                if (dataOfClass != null)
                {
                    this.mRequest = dataOfClass;
                }
                this.SetDetailActiveStatus(false);
                this.is_gift = this.CheckIsGiftData(GachaResultData.drops);
                for (int index = 0; index < GachaResultData.drops.Length; ++index)
                {
                    if (GachaResultData.drops[index].type == GachaDropData.Type.Unit)
                    {
                        MonoSingleton <GameManager> .Instance.Player.UpdateUnitTrophyStates(false);

                        break;
                    }
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.m_OnemoreBtn, (UnityEngine.Object)null))
                {
                    this.RefreshGachaCostObject(((Component)this.m_OnemoreBtn).get_gameObject());
                    ((Component)this.m_OnemoreBtn).get_gameObject().SetActive(GachaResultData.UseOneMore && !GachaResultData.IsRedrawGacha);
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.m_BonusBtn, (UnityEngine.Object)null))
                {
                    ((Component)this.m_BonusBtn).get_gameObject().SetActive(GachaResultData.dropMails != null && GachaResultData.dropMails.Length > 0);
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.m_RedrawBtn, (UnityEngine.Object)null))
                {
                    SerializeValueBehaviour component = (SerializeValueBehaviour)((Component)this.m_RedrawBtn).GetComponent <SerializeValueBehaviour>();
                    if (UnityEngine.Object.op_Inequality((UnityEngine.Object)component, (UnityEngine.Object)null))
                    {
                        GameObject gameObject = component.list.GetGameObject("option");
                        if (UnityEngine.Object.op_Inequality((UnityEngine.Object)gameObject, (UnityEngine.Object)null))
                        {
                            gameObject.SetActive(GachaResultData.IsPending);
                        }
                        Text uiLabel = component.list.GetUILabel("txt_count");
                        if (UnityEngine.Object.op_Inequality((UnityEngine.Object)uiLabel, (UnityEngine.Object)null))
                        {
                            string empty;
                            if (GachaResultData.IsPending)
                            {
                                empty = LocalizedText.Get("sys.GACHA_REDRAW_COUNT_LIMIT", new object[1]
                                {
                                    (object)GachaResultData.RedrawRest
                                });
                            }
                            else
                            {
                                empty = string.Empty;
                            }
                            string str = empty;
                            uiLabel.set_text(str);
                        }
                    }
                    ((Component)this.m_RedrawBtn).get_gameObject().SetActive(GachaResultData.IsRedrawGacha);
                    ((Selectable)this.m_RedrawBtn).set_interactable(GachaResultData.IsPending && GachaResultData.RedrawRest > 0);
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.m_DefaultBtn, (UnityEngine.Object)null))
                {
                    SerializeValueBehaviour component = (SerializeValueBehaviour)((Component)this.m_DefaultBtn).GetComponent <SerializeValueBehaviour>();
                    if (UnityEngine.Object.op_Inequality((UnityEngine.Object)component, (UnityEngine.Object)null))
                    {
                        component.list.GetUILabel("text").set_text(!GachaResultData.IsPending ? LocalizedText.Get("sys.BTN_GACHA_OK") : LocalizedText.Get("sys.BTN_DECIDE_CONFIRM"));
                    }
                }
                this.Refresh();
                this.m_inialize = true;
            }
        }