private void OnEnable()
 {
     BottleViewCtrl.GetInstance().drawState = DrawState.Nothing;
     this.legendGetFX.gameObject.SetActive(false);
     this.collectGetFX.gameObject.SetActive(false);
     this.Register();
 }
示例#2
0
 private void PurchaseExp(GameObject obj = null)
 {
     if (null != obj && BottleViewCtrl.GetInstance().drawState == DrawState.Nothing)
     {
         MobaMessageManagerTools.SendClientMsg(ClientV2C.bottleSystemAddExpBall, null, false);
     }
 }
 private void OnTimeOut(MobaMessage msg)
 {
     if (msg != null)
     {
         MobaMessageType mobaMessageType = MobaMessageType.GameCode;
         int             num             = 161;
         MsgData_WaitServerResponsTimeout msgData_WaitServerResponsTimeout = (MsgData_WaitServerResponsTimeout)msg.Param;
         if (msgData_WaitServerResponsTimeout.MobaMsgType == mobaMessageType && msgData_WaitServerResponsTimeout.MsgID == num)
         {
             BottleViewCtrl.GetInstance().drawState = DrawState.Nothing;
         }
     }
 }
示例#4
0
        private void AddExpPress(GameObject obj, bool isPress)
        {
            EquipmentInfoData equipmentInfoData = ModelManager.Instance.Get_equipmentList_X().Find((EquipmentInfoData eb) => eb.ModelId == 7777);

            if (!NetWorkHelper.Instance.IsGateAvailable)
            {
                Singleton <TipView> .Instance.ShowViewSetText("网络环境较差,请稍后再试", 1f);
            }
            else if (equipmentInfoData == null || equipmentInfoData.Count == 0)
            {
                this.PurchaseExp(obj);
            }
            else if (isPress)
            {
                if (BottleViewCtrl.GetInstance().drawState == DrawState.Nothing)
                {
                    BottleViewCtrl.GetInstance().drawState = DrawState.Drawing;
                    this.isStop  = false;
                    this.isClick = true;
                    if (this.long_coroutine != null)
                    {
                        base.StopCoroutine("IsLongPress");
                    }
                    this.long_coroutine = base.StartCoroutine("IsLongPress");
                }
            }
            else
            {
                this.isStop = true;
                if (this.long_coroutine != null)
                {
                    base.StopCoroutine("IsLongPress");
                }
                this.realTime = 0f;
                if (this.isClick)
                {
                    if (this.click_coroutine != null)
                    {
                        return;
                    }
                    MobaMessageManagerTools.SendClientMsg(ClientV2C.bottleSystemChangeBottleOnce, 0.3f, false);
                    this.UseExpBall(1);
                }
            }
        }
        private void RefreshDataUI()
        {
            List <EquipmentInfoData> list = ModelManager.Instance.Get_equipmentList_X();
            EquipmentInfoData        equipmentInfoData = new EquipmentInfoData();

            if (list != null)
            {
                equipmentInfoData = ModelManager.Instance.Get_equipmentList_X().Find((EquipmentInfoData obj) => obj.ModelId == 7777);
            }
            if (equipmentInfoData != null && equipmentInfoData.Count != 0)
            {
                MobaMessageManagerTools.SendClientMsg(ClientV2C.bottleSystemAddExpBallSuccess, equipmentInfoData.Count, false);
            }
            else
            {
                MobaMessageManagerTools.SendClientMsg(ClientV2C.bottleSystemAddExpBallSuccess, 0, false);
            }
            BottleViewCtrl.GetInstance().drawState = DrawState.Nothing;
        }
 private void OpenTreasure(GameObject obj)
 {
     if (null != obj)
     {
         if (BottleViewCtrl.GetInstance().drawState == DrawState.Drawing)
         {
             return;
         }
         if (obj.name.CompareTo("Legendary") == 0)
         {
             if (this.countLegend == 0)
             {
                 if (BottleViewCtrl.GetInstance().drawState == DrawState.Nothing)
                 {
                     MobaMessageManagerTools.SendClientMsg(ClientV2C.bottleSystemOpenSecondaryPanel, LackState.lackLegend, false);
                 }
                 return;
             }
             if (BottleViewCtrl.GetInstance().drawState == DrawState.Nothing)
             {
                 BottleViewCtrl.GetInstance().drawState = DrawState.Drawing;
                 this.ConfirmOpenLegend(true);
             }
         }
         if (obj.name.CompareTo("Collector") == 0)
         {
             if (this.countCollect == 0)
             {
                 if (BottleViewCtrl.GetInstance().drawState == DrawState.Nothing)
                 {
                     MobaMessageManagerTools.SendClientMsg(ClientV2C.bottleSystemOpenSecondaryPanel, LackState.lackCollect, false);
                 }
                 return;
             }
             if (BottleViewCtrl.GetInstance().drawState == DrawState.Nothing)
             {
                 BottleViewCtrl.GetInstance().drawState = DrawState.Drawing;
                 this.ConfirmOpenCollect(true);
             }
         }
     }
 }
 private void OnPeerDisconnected(MobaMessage msg)
 {
     BottleViewCtrl.GetInstance().drawState = DrawState.Nothing;
 }
 private void OnPeerConnected(MobaMessage msg)
 {
     MobaMessageManagerTools.SendClientMsg(ClientV2C.bottleSystemOpenView, null, false);
     BottleViewCtrl.GetInstance().drawState = DrawState.Nothing;
 }
 private void OnDisable()
 {
     this.Unregister();
     BottleViewCtrl.GetInstance().drawState = DrawState.Nothing;
 }