Example #1
0
    public void OnAskTeamrCopy(stAskTeamrCopyUserCmd_CS cmd)
    {
        m_uEnterCopyID = cmd.copy_base_id;
        m_dicTeammateStatus.Clear();
        TeamDataManager teamData = DataManager.Manager <TeamDataManager>();

        m_dicTeammateStatus.Add(teamData.LeaderId, true);


        CopyDataBase db = GameTableManager.Instance.GetTableItem <CopyDataBase>(cmd.copy_base_id);

        if (db == null)
        {
            return;
        }
        if (!KHttpDown.Instance().SceneFileExists(db.mapId))
        {
            stAnsTeamCopyUserCmd_CS sendCmd = new stAnsTeamCopyUserCmd_CS();
            sendCmd.ans          = false;
            sendCmd.copy_base_id = cmd.copy_base_id;
            NetService.Instance.Send(cmd);
            DataManager.Manager <UIPanelManager>().ShowPanel(PanelID.DownloadPanel);

            //TipsManager.Instance.ShowTips(LocalTextType.Team_Limit_nindedongwurenshuyiman);//您的队伍人数已满
            return;
        }
        else
        {
            DataManager.Manager <UIPanelManager>().ShowPanel(PanelID.FBConfirmPanel);
        }

        m_uCountDown = GameTableManager.Instance.GetGlobalConfig <uint>("EnterCopyCountdown");
        TimerAxis.Instance().KillTimer(m_uCopyAskTeamTimerID, this);
        TimerAxis.Instance().SetTimer(m_uCopyAskTeamTimerID, 1000, this);
    }
Example #2
0
    private void InvorkRobot()
    {
        TimerAxis.Instance().KillTimer(m_uCopyJumpTimerID, this);

        IControllerSystem cs = ClientGlobal.Instance().GetControllerSystem();

        if (cs == null)
        {
            Engine.Utility.Log.Error("ExecuteCmd: ControllerSystem is null");
            return;
        }
        if (cs.GetCombatRobot().Status != CombatRobotStatus.RUNNING)
        {
            if (EnterCopyID != 0)
            {
                cs.GetCombatRobot().StartInCopy(EnterCopyID, m_nLastKillWave, m_nLastTransmitWave);
            }
            else
            {
                cs.GetCombatRobot().Start();
            }
        }
        DataManager.Manager <UIPanelManager>().ShowMain();
        DataManager.Manager <UIPanelManager>().HidePanel(PanelID.LoadingPanel);
    }
Example #3
0
 void OnCustomLongPress(GameObject go, bool state)
 {
     if (state)
     {
         if (!bPress)
         {
             bPress = true;
             TimerAxis.Instance().SetTimer(m_uLongPressTimerID, m_uLongPressTime, this, 1);
         }
         else
         {
             if (m_upCallBack != null)
             {
                 m_upCallBack();
             }
         }
     }
     else
     {
         bPress = false;
         if (m_upCallBack != null)
         {
             m_upCallBack();
         }
         TimerAxis.Instance().KillTimer(m_uLongPressTimerID, this);
     }
 }
Example #4
0
 public void PopPushPanel()
 {
     if (pushQueue.Count != 0)
     {
         if (DataManager.Manager <UIPanelManager>().IsShowPanel(PanelID.CommonPushPanel))
         {
             return;
         }
         PushItem item = pushQueue.Dequeue();
         if (item != null)
         {
             DataManager.Manager <UIPanelManager>().ShowPanel(PanelID.CommonPushPanel, panelShowAction: (pb) =>
             {
                 if (null != pb && pb is CommonPushPanel)
                 {
                     CommonPushPanel panel = pb as CommonPushPanel;
                     panel.InitPushItem(item);
                     m_uCurrentPushItem = item;
                     if (!TimerAxis.Instance().IsExist(m_uPushTimerID, this))
                     {
                         TimerAxis.Instance().SetTimer(m_uPushTimerID, 1000, this);
                     }
                 }
             });
         }
     }
     else
     {
         if (!DataManager.Manager <UIPanelManager>().IsShowPanel(PanelID.CommonPushPanel))
         {
             TimerAxis.Instance().KillTimer(m_uPushTimerID, this);
         }
     }
 }
Example #5
0
    /// <summary>
    /// 战斗结果
    /// </summary>
    void ShowResult()
    {
        m_trans_start.gameObject.SetActive(false);
        m_trans_result.gameObject.SetActive(true);

        ArenaBattleResult battleResult = AManager.ArenaBattleResult;

        if (battleResult.result == 1)//胜
        {
            m_sprite_win.gameObject.SetActive(true);
            m_sprite_defeat.gameObject.SetActive(false);

            m_sprite_add.gameObject.SetActive(true);
            m_sprite_less.gameObject.SetActive(false);
        }
        else
        {
            m_sprite_win.gameObject.SetActive(false);
            m_sprite_defeat.gameObject.SetActive(true);

            m_sprite_add.gameObject.SetActive(false);
            m_sprite_less.gameObject.SetActive(true);
        }

        m_label_Rank_Change.text = battleResult.changeRank.ToString();
        m_label_integral.text    = battleResult.score.ToString();


        m_resultCDTime          = 10;//结算倒计时
        m_label_close_time.text = m_resultCDTime.ToString();
        TimerAxis.Instance().KillTimer(ARENARESULT_TIMERID, this);
        TimerAxis.Instance().SetTimer(ARENARESULT_TIMERID, 1000, this);
    }
Example #6
0
    void ExitArena()
    {
        TimerAxis.Instance().KillTimer(ARENAATART_TIMERID, this);
        TimerAxis.Instance().KillTimer(ARENARESULT_TIMERID, this);

        HideSelf();
    }
Example #7
0
    void CommonGuiYuan(GameObject caster)
    {
        if (bStart)
        {
            return;
        }


        if (!CheckItem())
        {
            return;
        }

        stGuiYuanPetUserCmd_CS cmd = new stGuiYuanPetUserCmd_CS();

        cmd.id       = CurPet.GetID();
        cmd.adv      = false;
        cmd.auto_buy = autoConsume;
        NetService.Instance.Send(cmd);
        if (autoPrefect)
        {
            caster.SetActive(false);
            m_btn_tingzhiguiyuan.gameObject.SetActive(true);
            bStart = true;
            TimerAxis.Instance().SetTimer(m_uGuiyuanTimerID, 1000, this);
        }
    }
Example #8
0
 void StopGuiyuan()
 {
     m_btn_tingzhiguiyuan.gameObject.SetActive(false);
     m_btn_kaishiguiyuan.gameObject.SetActive(true);
     bStart = false;
     TimerAxis.Instance().KillTimer(m_uGuiyuanTimerID, this);
 }
Example #9
0
 protected override void OnStart()
 {
     base.OnStart();
     TimerAxis.Instance().SetTimer(m_uBuffItemTimerID, 1000, this);
     // InitControls();
     InitUI();
 }
Example #10
0
    public void OnTimer(uint uTimerID)
    {
        if (uTimerID == ITEMCD_TIMERID)
        {
            if (overlay == null)
            {
                return;
            }

            if (timeLbl == null)
            {
                return;
            }

            if (this.item == null)
            {
                return;
            }

            ItemManager.CDData cdData;
            if (DataManager.Manager <ItemManager>().TryGetItemCDByBaseId(this.item.itemid, out cdData))
            {
                SetCDState(true);
                overlay.fillAmount = cdData.remainCD / cdData.totalCD;
                timeLbl.text       = ((int)cdData.remainCD + 1).ToString();
            }
            else
            {
                SetCDState(false);
                overlay.fillAmount = 0;
                timeLbl.text       = "";
                TimerAxis.Instance().KillTimer(ITEMCD_TIMERID, this);
            }
        }
    }
Example #11
0
 void KillCancleTimer()
 {
     if (TimerAxis.Instance().IsExist(m_cancleTimerID, this))
     {
         TimerAxis.Instance().KillTimer(m_cancleTimerID, this);
     }
 }
Example #12
0
 protected override void OnHide()
 {
     base.OnHide();
     m_widget_mask.gameObject.SetActive(false);
     TimerAxis.Instance().KillTimer(ARENAATART_TIMERID, this);
     TimerAxis.Instance().KillTimer(ARENARESULT_TIMERID, this);
 }
Example #13
0
    protected override void OnShow(object data)
    {
        float questionTime = DataManager.Manager <AnswerManager>().QuestionTime;

        if (questionTime > 0 && questionTime <= 5)
        {
            this.m_CDTime = Mathf.CeilToInt(questionTime);

            m_label_CD.gameObject.SetActive(true);

            m_label_CD.text = m_CDTime.ToString();
            m_tweenScale.ResetToBeginning();
            m_tweenScale.from     = new Vector3(1f, 1f, 1f);
            m_tweenScale.to       = new Vector3(0.1f, 0.1f, 0.1f);
            m_tweenScale.duration = 1f;
            m_tweenScale.PlayForward();

            TimerAxis.Instance().KillTimer(ANSWERCD_TIMERID, this);
            TimerAxis.Instance().SetTimer(ANSWERCD_TIMERID, 1000, this);
        }
        else
        {
            m_label_CD.gameObject.SetActive(false);
        }
    }
Example #14
0
    protected override void OnHide()
    {
        base.OnHide();

        this.m_CDTime = 0;
        TimerAxis.Instance().KillTimer(ANSWERCD_TIMERID, this);
    }
Example #15
0
 public void OnDisable()
 {
     if (TimerAxis.Instance().IsExist(m_uBuffUITimerID, this))
     {
         TimerAxis.Instance().KillTimer(m_uBuffUITimerID, this);
     }
 }
Example #16
0
    void SetGainOrAtOnce()
    {
        if (DataManager.Manager <HomeDataManager>().CanGetLeftTime((int)(this.m_farmId + m_animalIndexStart)))
        {
            if (m_SeedIndexDic.ContainsKey(m_farmId + m_animalIndexStart))
            {
                SeedAndCubDataBase cubData = GameTableManager.Instance.GetTableItem <SeedAndCubDataBase>(m_SeedIndexDic[m_farmId + m_animalIndexStart]);
                if (cubData != null)
                {
                    m_Icon.spriteName = cubData.icon;
                    m_lblName.text    = cubData.name;
                }
            }

            if (DataManager.Manager <HomeDataManager>().GetLeftTimeByIndex((int)(this.m_farmId + m_animalIndexStart)) == 0)
            {
                SetGainOrAtOnceBtn(true);
            }
            else
            {
                SetGainOrAtOnceBtn(false);

                this.m_nLeftTime = DataManager.Manager <HomeDataManager>().GetLeftTimeByIndex((int)(m_farmId + m_animalIndexStart));
                if (m_nLeftTime > 0)
                {
                    TimerAxis.Instance().KillTimer(HOMEANIMAL_TIMERID, this);
                    TimerAxis.Instance().SetTimer(HOMEANIMAL_TIMERID, 1000, this);
                }
                else
                {
                    TimerAxis.Instance().KillTimer(HOMEANIMAL_TIMERID, this);
                }
            }
        }
    }
Example #17
0
 /// <summary>
 /// 结算
 /// </summary>
 void CityWarFinish()
 {
     m_btn_ExitBtn.gameObject.SetActive(true);
     m_exitTime = 10;
     TimerAxis.Instance().KillTimer(CITYWAREXIT_TIMERID, this);
     TimerAxis.Instance().SetTimer(CITYWAREXIT_TIMERID, 1000, this);
 }
Example #18
0
    public void OnTimer(uint uTimerID)
    {
        if (uTimerID == m_uWaitTimerID)
        {
            m_nCountDown -= 1;
            if (m_WaitShowData == null)
            {
                TimerAxis.Instance().KillTimer(m_uWaitTimerID, this);
                HideSelf();
                return;
            }

            if (m_label_countdown != null && m_WaitShowData.showTimer)
            {
                m_label_countdown.text = m_nCountDown.ToString();
            }

            if (m_nCountDown <= 0)
            {
                if (m_WaitShowData.timeOutDel != null)
                {
                    m_WaitShowData.timeOutDel.Invoke();
                }
                TimerAxis.Instance().KillTimer(m_uWaitTimerID, this);
                HideSelf();
            }
        }
    }
Example #19
0
    public void RunCD()
    {
        if (IsCDing)
        {
            Log.LogGroup("ZDY", "run cd and is cding ");
            return;
        }


        Client.IPlayer mainPlayer = ClientGlobal.Instance().MainPlayer;
        if (mainPlayer == null)
        {
            Log.Error("main player is null");
            return;
        }

        SkillCDInfo cdInfo = DataManager.Manager <SkillCDManager>().GetSkillCDBySkillId((uint)m_skillid);

        if (cdInfo != null)
        {
            IsCDing = true;
            SetBtnEnable(false);
            if (!TimerAxis.Instance().IsExist(m_uSkillUseTimeID, this))
            {
                //   Log.LogGroup("ZDY", "start cd " );
                TimerAxis.Instance().SetTimer(m_uSkillUseTimeID, 30, this);
            }
        }
        else
        {
            SetBtnEnable(true);
            //Log.LogGroup("ZDY", "run cd info is null " + m_skillid);
        }
    }
Example #20
0
    public void OnTimer(uint uTimerID)
    {
        if (uTimerID == m_uSkillUseTimeID)
        {
            if (overlay == null)
            {
                ResetBtn();
                TimerAxis.Instance().KillTimer(m_uSkillUseTimeID, this);
                //  Log.Error("over lay is null cd timer");
                return;
            }
            // Log.LogGroup("ZDY", "cd timer running");
            SkillCDInfo cdInfo = DataManager.Manager <SkillCDManager>().GetSkillCDBySkillId((uint)m_skillid);
            if (cdInfo != null)
            {
                if (cdInfo.currTime > 0 && cdInfo.totalTime != 0)
                {
                    overlay.fillAmount = cdInfo.currTime / cdInfo.totalTime;
                    //Log.LogGroup("ZDY", "cdInfo.currTime is "+cdInfo.currTime+ " fillamount is "+overlay.fillAmount);
                    if (skillName != null)
                    {
                        skillName.text = ((int)cdInfo.currTime + 1).ToString();
                    }
                    return;
                }
            }

            ResetBtn();
            //     Log.LogGroup("ZDY","cdinfo is null skillid is " + m_skillid);
            TimerAxis.Instance().KillTimer(m_uSkillUseTimeID, this);
        }
    }
Example #21
0
    public void OnTimer(uint uTimerID)
    {
        if (uTimerID == ANSWERCD_TIMERID)
        {
            this.m_CDTime--;
            if (this.m_CDTime > 0)
            {
                m_label_CD.text = this.m_CDTime.ToString();

                m_tweenScale.ResetToBeginning();

                m_tweenScale.from     = new Vector3(1f, 1f, 1f);
                m_tweenScale.to       = new Vector3(0.1f, 0.1f, 0.1f);
                m_tweenScale.duration = 1f;

                m_tweenScale.PlayForward();
            }
            else
            {
                if (this.m_CDTime <= 0)
                {
                    //结束3、2、1 正式开始战斗
                    m_label_CD.gameObject.SetActive(false);

                    TimerAxis.Instance().KillTimer(ANSWERCD_TIMERID, this);
                }
            }
        }
    }
Example #22
0
 void KillOkTimer()
 {
     if (TimerAxis.Instance().IsExist(m_okTimerID, this))
     {
         TimerAxis.Instance().KillTimer(m_okTimerID, this);
     }
 }
Example #23
0
    void Update()
    {
        if (m_bLongPress)
        {
            m_pressTime += Time.deltaTime;
            if (m_nTimerIndex < m_TimerKeyList.Count)
            {
                float time = m_TimerKeyList[m_nTimerIndex];
                if (m_pressTime >= time)
                {
                    m_nTimerIndex++;
                    TimerAxis.Instance().KillTimer(m_uUseItemTimerID, this);

                    uint delta = GameTableManager.Instance.GetGlobalConfig <uint>("QuickUseItemTime", time.ToString());
                    Log.Error("set timer " + delta.ToString());
                    TimerAxis.Instance().SetTimer(m_uUseItemTimerID, delta, this);
                }
            }
        }
        else
        {
            if (TimerAxis.Instance().IsExist(m_uUseItemTimerID, this))
            {
                TimerAxis.Instance().KillTimer(m_uUseItemTimerID, this);
            }

            m_uWillUseItemNum = 0;
            m_pressTime       = 0;
            m_nTimerIndex     = 0;
        }
    }
Example #24
0
 public void OnTimer(uint uTimerID)
 {
     if (uTimerID == TOKENTASK_TIMERID)
     {
         GoToDoTokenTask();
         TimerAxis.Instance().KillTimer(TOKENTASK_TIMERID, this);
     }
 }
Example #25
0
 protected override void OnShow(object data)
 {
     base.OnShow(data);
     if (!TimerAxis.Instance().IsExist(timerID, this))
     {
         TimerAxis.Instance().SetTimer(timerID, 3000, this);
     }
 }
Example #26
0
    public void OnJumpCopy(stJumpCopyUserCmd_S cmd)
    {
        m_nLastTransmitWave = cmd.pos - 1;

        m_nLastKillWave = cmd.wave;
        ClientGlobal.Instance().GetMapSystem().Process = 0f;
        TimerAxis.Instance().SetTimer(m_uCopyJumpTimerID, 50, this, 20);
    }
Example #27
0
    public void StartSliderByEvent(float duration, GameCmd.UninterruptActionType type)
    {
        if (DataManager.Manager <SliderDataManager>().IsReadingSlider&& type == m_UninterruptActionType)
        {
            if (type == GameCmd.UninterruptActionType.UninterruptActionType_GOHOME)
            {
                m_duration  = duration;
                m_startTime = UnityEngine.Time.realtimeSinceStartup;
                return;
            }
            Log.LogGroup("ZDY", "StartSliderByEvent  在读条中" + type.ToString());
            return;
        }

        if (type == GameCmd.UninterruptActionType.UninterruptActionType_DEMON)
        {
            bool canRide = Engine.Utility.EventEngine.Instance().DispatchVote((int)Client.GameVoteEventID.RIDE_CANRIDE, null);
            if (!canRide)
            {
                m_UninterruptActionType = GameCmd.UninterruptActionType.UninterruptActionType_None;
                return;
            }
        }
        else if (type == GameCmd.UninterruptActionType.UninterruptActionType_GOHOME)
        {
        }
        m_UninterruptActionType = type;



        //DataManager.Manager<SliderDataManager>().IsReadingSlider = true;

        IsReadingSlider = true;

        if (type != GameCmd.UninterruptActionType.UninterruptActionType_SkillCJ)
        {
            Engine.Utility.EventEngine.Instance().AddEventListener((int)GameEventID.ENTITYSYSTEM_ENTITYBEGINMOVE, MoveCancel);
        }
        DataManager.Manager <UIPanelManager>().ShowPanel(PanelID.SliderPanel, panelShowAction: (panel) =>
        {
            DispatchValueUpdateEvent(new ValueUpdateEventArgs()
            {
                key = SliderDataEnum.Begin.ToString()
            });
        });


        //Log.Info("slider duration is " + duration.ToString());
        //DataManager.Manager<SliderDataManager>().IsBreak = false;
        bbreak = false;

        bOver      = false;
        m_duration = duration;
        //DataManager.Manager<TaskDataManager>().IsShowSlider = true;
        m_startTime       = UnityEngine.Time.realtimeSinceStartup;
        m_uCurrentProcess = 0;
        TimerAxis.Instance().SetTimer(m_uSliderTimerID, m_uInterval, this);
    }
Example #28
0
    public void Initialize()
    {
        EventEngine.Instance().AddEventListener((int)GameEventID.SYSTEM_LOADSCENECOMPELETE, DoGameEvent);
        EventEngine.Instance().AddEventListener((int)GameEventID.PLAYER_LOGIN_SUCCESS, DoGameEvent);
        EventEngine.Instance().AddEventListener((int)GameEventID.HOMELAND_CLICKENTITY, DoGameEvent);

        TimerAxis.Instance().SetTimer(m_uHomeTimerID, 1000, this);
        InitTradeItemDic();//大管家
    }
Example #29
0
    /// <summary>
    /// 描述和CD
    /// </summary>
    /// <param name="info"></param>
    void SetDesAndCD(stCopyBattleInfo info)
    {
        this.m_cdTime = info.cd;

        m_label_NvWaTimeNum.text = info.cd.ToString();

        TimerAxis.Instance().KillTimer(NVWA_TIMERID, this);
        TimerAxis.Instance().SetTimer(NVWA_TIMERID, 1000, this);
    }
Example #30
0
    /// <summary>
    /// 开启阵营战战前提醒
    /// </summary>
    private void EnableCampNotice()
    {
        ResetCampNotice();
        m_bCampNoticeEnable = true;

        //新的方式  阵营战战前提醒
        this.m_campStartTipsCount = 3;
        TimerAxis.Instance().SetTimer(TIME_ID, 1000, this);
    }