public void ShowTopBar(MainMenuDisplayState state = MainMenuDisplayState.ShowTopBar) { _topBar.gameObject.SetActive(true); bool isPowerBar = state == MainMenuDisplayState.ShowTopBar; _topBar.Find("PowerBar").gameObject.SetActive(isPowerBar); if (isPowerBar) { _topBar.Find("VisitPowerBar").gameObject.SetActive(!isPowerBar); _recolletionBar.gameObject.SetActive(!isPowerBar); _exchangeIntegralBar.gameObject.SetActive(!isPowerBar); } else { switch (state) { case MainMenuDisplayState.ShowVisitTopBar: _topBar.Find("VisitPowerBar").gameObject.SetActive(false); _recolletionBar.gameObject.SetActive(false); _exchangeIntegralBar.gameObject.SetActive(false); break; case MainMenuDisplayState.ShowRecollectionTopBar: _topBar.Find("VisitPowerBar").gameObject.SetActive(false); _recolletionBar.gameObject.SetActive(true); _exchangeIntegralBar.gameObject.SetActive(false); break; case MainMenuDisplayState.ShowExchangeIntegralBar: _topBar.Find("VisitPowerBar").gameObject.SetActive(false); _recolletionBar.gameObject.SetActive(false); _exchangeIntegralBar.gameObject.SetActive(true); break; } } _userInfoView.gameObject.SetActive(false); _buttons.gameObject.SetActive(false); _activityBar.gameObject.SetActive(false); _startPathBtnContainer.gameObject.SetActive(false); _backGround.gameObject.Hide(); _characterContainer.gameObject.Hide(); _live2dGraphic.Hide(); }
public override void OnMessage(Message message) //主菜单消息发送 { string name = message.Name; object[] body = message.Params; bool isStopPlayDubbing = true; switch (name) { case MessageConst.CMD_MAIN_ON_STAR_ACTIVITY_BTN: if (GlobalData.MissionModel.IsShowStarActivity()) { ModuleManager.Instance.EnterModule(ModuleConfig.MODULE_STAR_ACTIVITY, false, true, GlobalData.MissionModel.GetOpenDay()); } else { view.HandleFunctionOpen(); } break; case MessageConst.CMD_MAIN_CHANGE_DISPLAY: //--主菜单显示状态 Star MainMenuDisplayState state = (MainMenuDisplayState)message.Body; PopupManager.StopHandleShowWindow(); switch (state) { case MainMenuDisplayState.ShowAll: view.ShowAll(); //CheckNeedToDownLoadExtend(); PopupManager.ShowPhoneTipsWindow(() => SendRedPoint()); break; case MainMenuDisplayState.ShowUserInfo: view.ShowUserInfo(); break; case MainMenuDisplayState.ShowUserInfoAndTopBar: view.ShowTopBarAndUserInfo(); break; case MainMenuDisplayState.ShowTopBar: view.ShowTopBar(); break; case MainMenuDisplayState.ShowVisitTopBar: view.ShowTopBar(MainMenuDisplayState.ShowVisitTopBar); break; case MainMenuDisplayState.HideAll: if (_window != null) { _window.Close(); } view.ShowAll(false); break; case MainMenuDisplayState.ShowRecollectionTopBar: view.ShowTopBar(MainMenuDisplayState.ShowRecollectionTopBar); break; case MainMenuDisplayState.ShowExchangeIntegralBar: view.ExchangeIntegralBarSetData(GlobalData.TrainingRoomModel.GetCurIntegral()); view.ShowTopBar(MainMenuDisplayState.ShowExchangeIntegralBar); break; default: throw new ArgumentOutOfRangeException(); } //--主菜单显示状态 End break; case MessageConst.CMD_MAIN_ON_START_BTN: var isShowArrow = (bool)body[0]; Debug.LogError("isShowArrow===>" + isShowArrow); ModuleManager.Instance.EnterModule(ModuleConfig.MODULE_GAME_PLAY, false, true, isShowArrow); //--模块消息发送 Start break; case MessageConst.CMD_MAIN_ON_CARD_BTN: ModuleManager.Instance.EnterModule(ModuleConfig.MODULE_CARD); break; case MessageConst.CMD_MAIN_ON_SUPPORTER_BTN: ModuleManager.Instance.EnterModule(ModuleConfig.MODULE_SUPPORTER); break; case MessageConst.CMD_TASK_SHOW_DAILYTASK: ModuleManager.Instance.EnterModule(ModuleConfig.MODULE_MISSION); break; case MessageConst.CMD_GOTOACHIEVEMENT: ModuleManager.Instance.EnterModule(ModuleConfig.MODULE_ACHIEVEMENT); break; case MessageConst.CMD_APPOINTMENT_JUMPCHOOSEROLE: ModuleManager.Instance.EnterModule(ModuleConfig.MODULE_LOVE); //PopupManager.ShowWindow<LoveJumpWindow>("GameMain/Prefabs/LoveJumpWindow/LoveJumpWindow"); break; case MessageConst.CMD_MAIN_ON_CHANGE_ROLE_BTN: ModuleManager.Instance.EnterModule(ModuleConfig.MODULE_FAVORABILITYMAIN); break; case MessageConst.CMD_MAIN_ON_DRAWCARD_BTN: ModuleManager.Instance.EnterModule(ModuleConfig.MODULE_DRAWCARD); break; case MessageConst.CMD_MAIN_ON_PHONE_BTN: ModuleManager.Instance.EnterModule(ModuleConfig.MODULE_PHONE); break; case MessageConst.CMD_MAIN_ON_ACTIVITY_BTN: //SendActivityMsg(); //进入活动模块 var id = (string)message.Body; ModuleManager.Instance.EnterModule(ModuleConfig.MODULE_ACTIVITY, false, true, id); break; case MessageConst.CMD_MAIN_ON_MAIL_BTN: PopupManager.StopHandleShowWindow(); ModuleManager.Instance.EnterModule(ModuleConfig.MODULE_MAIL); break; case MessageConst.CMD_MAIN_ON_ALBUM_BTN: FlowText.ShowMessage(I18NManager.Get("Common_Underdevelopment")); break; case MessageConst.CMD_MAIN_ON_STAGINGPOST_BTN: ModuleManager.Instance.EnterModule(ModuleConfig.MODULE_SHOP, false, true, 0); break; case MessageConst.CMD_MAIN_SHOW_BUY_POWER: //买体力 var _buyPowerUpperlimit = GlobalData.PlayerModel.BuyPowerUpperlimit; //10 if (GlobalData.PlayerModel.PlayerVo.PowerNum >= _buyPowerUpperlimit) { FlowText.ShowMessage(I18NManager.Get("Common_TodaysBuyUpperlimit")); // ("今日兑换次数已达上限"); return; } else { ShowBuyPowerWindow(); } break; case MessageConst.CMD_MAIN_SHOW_BUY_GOLD: //买金币 var _buyGlodUpperlimit = GlobalData.PlayerModel.BuyGoldUpperlimit; //10 if (GlobalData.PlayerModel.PlayerVo.GoldNum >= _buyGlodUpperlimit) { FlowText.ShowMessage(I18NManager.Get("Common_TodaysBuyUpperlimit")); return; } else { ShowBuyGlodWindow(); } break; case MessageConst.CMD_SUPPORTERACTIVITY_BUYENCOURAGEPOWER: //买应援行动力 var _buyEncouragePowerUpperlimit = GlobalData.PlayerModel.BuyEncouragePowerUpperlimit; //5 if (GlobalData.PlayerModel.PlayerVo.EncourageNum >= _buyEncouragePowerUpperlimit) { FlowText.ShowMessage(I18NManager.Get("Common_TodaysBuyUpperlimit")); return; } else { BuyEncouragePower(); } break; case MessageConst.CMD_MAIN_SHOW_BUY_GEM: ModuleManager.Instance.EnterModule(ModuleConfig.MODULE_SHOP, false, true, 5); //ModuleManager.Instance.EnterModule(ModuleConfig.MODULE_BUYGEN); // ModuleManager.Instance.EnterModule(ModuleConfig.MODULE_PAY,false); // (SdkHelper.PayAgent as PayAgentGooglePlay)?.Test(); break; case MessageConst.CMD_RECOLLECTION_SENDBUYEVENT: EventDispatcher.TriggerEvent(EventConst.SendBuyRecolletionPowerEvent); break; case MessageConst.CMD_MAIN_ON_LIVE2DCLICK: isStopPlayDubbing = false; SendNpcMainStageInteract(); break; case MessageConst.CMD_MAIN_ON_FIRITSRECHARGE_BTN: //通过首冲进入活动模块 ModuleManager.Instance.EnterModule(ModuleConfig.MODULE_ACTIVITYFIRSTRECHARGE, false, true); break; case MessageConst.CMD_MAIN_STORESCORECOMMENT: bool commentType = (bool)body[0]; string comment = (string)body[1]; int star = (int)body[2]; Debug.LogError(comment.Length); if (commentType) { SetCommentRes(true, comment, star); } else { if (comment.Length < 20) { FlowText.ShowMessage(I18NManager.Get("GameMain_MinTextCount")); return; } else if (comment.Length > 600) { FlowText.ShowMessage(I18NManager.Get("GameMain_MaxTextCount")); return; } SetCommentRes(false, comment, star); } break; case MessageConst.CMD_MAIN_FIRESHDOWNLOADAWARD: // Debug.LogError("has receiveDownload"+GlobalData.PlayerModel.PlayerVo.ExtInfo.DownloadReceive); //GuideManager.SetStatisticsRemoteGuideStep(GuideConst.MainLineStep_Extend_DowndLoad); if (GlobalData.PlayerModel.PlayerVo.ExtInfo.DownloadReceive == 0) { NetWorkManager.Instance.Send <ReceiveDownloadAwardsRes>(CMD.DOWNLOAD_RECEIVEAWARD, null, OnDownloadReceiveAward); } // else // { // Debug.LogError("另外奖励又重新删包,在下载"); // SendMessage(new Message(MessageConst.CMD_DOWNLOAD_OK)); // } break; case MessageConst.CMD_MAIN_ON_PLAYERBIRTHDAY: if (GlobalData.MissionModel.IsShowPlayerBirthday()) { ModuleManager.Instance.EnterModule(ModuleConfig.MODULE_PLAYERBIRTHDAY, false, true, GlobalData.MissionModel.GetPlayerBirthdayOpenDay()); } else { view.HandleFunctionOpen(); } break; case MessageConst.CMD_MAIN_ON_ACTIVITYTEMPLATE_BTN: if (GlobalData.ActivityModel.IsShowActivityTemplateBtn(ActivityTypePB.ActivityDrawTemplate)) { ModuleManager.Instance.EnterModule(ModuleConfig.MODULE_ACTIVITYTEMPLATE, false, true); } else { view.HandleFunctionOpen(); } break; case MessageConst.CMD_MAIN_ON_ACTIVITYCAPSULETEMPLATE_BTN: ModuleManager.Instance.EnterModule(ModuleConfig.MODULE_ACTIVITYCAPSULETEMPLATE, false, true); break; case MessageConst.CMD_MAIN_ON_TOTALRECHARGE_BTN: ModuleManager.Instance.EnterModule(ModuleConfig.MODULE_ACTIVITY, false, true, GlobalData.ActivityModel.GetActivityVo(ActivityType.ActivityAccumulativeRecharge).JumpId); break; case MessageConst.CMD_MAIN_ON_ACTIVITYMUSICTEMPLATE_BTN: ModuleManager.Instance.EnterModule(ModuleConfig.MODULE_ACTIVITYMUSICTEMPLATE, false, true); break; default: return; } if (isStopPlayDubbing) { StopPlayingDubbing(); } }
private void OnMainMenuDisplayChange(MainMenuDisplayState state) { SendMessage(new Message(MessageConst.CMD_MAIN_CHANGE_DISPLAY, state)); }
public static void ChangeMenu(MainMenuDisplayState state) { EventDispatcher.TriggerEvent(EventConst.MainMenuDisplayChange, state); }