public void StartTimer(int nTimerID, cmd_add_match_info cmdData) { ReturnMatchBtn.gameObject.SetActive(false); UsedTime.text = "00 : 00"; m_CurMatchTimeSec = 0; m_nCurPlayerCount = cmdData.nCurMatchPlayerCount; m_nMaxPlayerCount = cmdData.nMaxPlayerCount; CurPlayerCountTxt.text = m_nCurPlayerCount.ToString(); // 更新当前玩家数量 CurPlayerCountTxt.text = m_nCurPlayerCount + " / " + m_nMaxPlayerCount; TimerManager.SetTimer(this, nTimerID, 1.0f); switch (cmdData.nMatchTypeID) { case (int)EMMatchType.MatchType_MachineMatch: { Title.text = ULocalizationService.Instance.Get("UIView", "MatchTimeInfo", "MachineTitle"); } break; case (int)EMMatchType.MatchType_First5Match: case (int)EMMatchType.MatchType_Match: { Title.text = ULocalizationService.Instance.Get("UIView", "MatchTimeInfo", "MatchTitle"); } break; case (int)EMMatchType.MatchType_Rank: { Title.text = ULocalizationService.Instance.Get("UIView", "MatchTimeInfo", "RankTitle"); } break; case (int)EMMatchType.MatchType_MultiCampMatch: { Title.text = ULocalizationService.Instance.Get("UIView", "MatchTimeInfo", "SurvivalTitle"); } break; default: break; } //if (m_tween == null) //{ // m_tween = RotateIcon.transform.DORotate(new Vector3(0.0f, 0.0f, 360.0f), 0.5f, RotateMode.FastBeyond360).SetEase(Ease.Linear).SetLoops(-1); //} }
// 接受消息 public override void OnMessage(WndMsgID msgID, UIMsgData msgData) { switch (msgID) { case WndMsgID.WND_MSG_COMMOM_STATICGAMESTATE_ENTER: { LoadView(); } break; case WndMsgID.WND_MSG_MSTCHTIMEINFO_SHOW: { if (m_wndView == null) { return; } UIMsgCmdData cmdData = (UIMsgCmdData)msgData; cmd_add_match_info data = IntPtrHelper.toData <cmd_add_match_info>(cmdData.ptrParam); LogicDataCenter.viewPersonStateDataManager.bIsMatching = true; m_wndView.SetVisible(true); m_wndView.StartTimer((int)EN_MatchInfo_Timer.ENMT_UsedTimer, data); m_wndView.KillTimer((int)EN_MatchInfo_Timer.ENMT_LeftTimer); } break; case WndMsgID.WND_MSG_ACCEPTWAIT_SHOW: { if (m_wndView == null) { return; } m_wndView.SetVisible(false); m_wndView.KillTimer((int)EN_MatchInfo_Timer.ENMT_UsedTimer); m_wndView.KillTimer((int)EN_MatchInfo_Timer.ENMT_LeftTimer); } break; case WndMsgID.WND_MSG_MSTCHTIMEINFO_HIDE: { LogicDataCenter.viewPersonStateDataManager.bIsMatching = false; if (m_wndView == null) { return; } m_wndView.SetVisible(false); m_wndView.KillTimer((int)EN_MatchInfo_Timer.ENMT_UsedTimer); m_wndView.KillTimer((int)EN_MatchInfo_Timer.ENMT_LeftTimer); } break; case WndMsgID.WND_MSG_MSTCHTIMEINFO_CUR_MATCH_PLAYER_COUNT: { if (!LogicDataCenter.viewPersonStateDataManager.bIsMatching) { return; } if (m_wndView == null) { return; } // 显示玩家人数倒计时间 UIMsgCmdData cmdData = (UIMsgCmdData)msgData; cmd_match_cur_player_count data = IntPtrHelper.toData <cmd_match_cur_player_count>(cmdData.ptrParam); m_wndView.UpdateCurPlayerCount(data.nCurCount, data.nMaxCount, data.nLeftTime); } break; case WndMsgID.WND_MSG_COMMOM_MATCHROOMSTATE_ENTER: { LogicDataCenter.viewPersonStateDataManager.bIsMatching = false; if (m_wndView == null) { return; } m_wndView.SetVisible(false); m_wndView.KillTimer((int)EN_MatchInfo_Timer.ENMT_UsedTimer); m_wndView.KillTimer((int)EN_MatchInfo_Timer.ENMT_LeftTimer); UnloadView(); } break; case WndMsgID.WND_MSG_MSTCHTIMEINFO_RETURN_MATCH_SHOW: { if (m_wndView == null) { return; } m_wndView.SetReturnMatchState(); m_wndView.SetVisible(true); } break; case WndMsgID.WND_MSG_MSTCHTIMEINFO_RETURN_MATCH_HIDE: { if (m_wndView == null) { return; } m_wndView.SetVisible(false); } break; #region 新手引导部分 case WndMsgID.WND_MSG_MSTCHIIMEINFO_GUIDE_ACTIONBEGIN: { if (m_wndView != null) { m_wndView.GuideActionBegin(); } } break; case WndMsgID.WND_MSG_MSTCHIIMEINFO_GUIDE_ACTIONEND: { if (m_wndView != null) { m_wndView.GuideActionEnd(); } } break; #endregion default: break; } }