public CategoryMenuPage(FrontMenu frontMenu) { InitializeComponent(); CategoryMenus = new ObservableCollection <Menus>(); foreach (var categoryMenu in frontMenu.menus) { CategoryMenus.Add(categoryMenu); } LvCategoryMenu.ItemsSource = CategoryMenus; }
public void Menu(int n) { switch (n) { case 0: PlayerInfo.SetActive(true); FrontMenu.SetActive(true); HelpMenu.SetActive(false); LogOffMenu.SetActive(false); break; case 1: PlayerInfo.SetActive(false); FrontMenu.SetActive(false); HelpMenu.SetActive(true); break; case 2: PlayerInfo.SetActive(false); FrontMenu.SetActive(false); LogOffMenu.SetActive(true); break; case 3: PlayerMenu.SetActive(true); PlayerInfo.SetActive(true); FrontMenu.SetActive(true); HelpMenu.SetActive(false); LogOffMenu.SetActive(false); MenuIcon.SetActive(false); GameObject.Find("Me").GetComponent <Movement> ().Position(true); break; case 4: GameObject.Find("Me").GetComponent <Movement> ().Position(false); PlayerMenu.SetActive(false); MenuIcon.SetActive(true); break; case 5: StartCoroutine(Disconnect()); break; } }
public async Task <ActionResult> Save(FrontMenuModel model) { var result = new JsonModel(); if (!ModelState.IsValid) { result.GetError(ModelState); return(Json(result)); } FrontMenu menu = null; var operationType = OperationType.Insert; if (model.Id > 0) { operationType = OperationType.Update; menu = await FrontMenuRepository.GetByIdAsync(model.Id); if (menu == null) { result.statusCode = 300; result.message = "该条数据不存在,请刷新重试!"; return(Json(result)); } } else { menu = new FrontMenu(); } menu = Mapper.Map(model, menu); menu.CommonStatus = CommonStatus.Enabled; await FrontMenuRepository.SaveAsync(menu); await LogRepository.Insert(TableSource.FrontMenu, operationType, "", menu.Id); menu.IndexOfParent = await FrontMenuRepository.GetIndexOfParent(menu); result.Data = menu; result.message = "保存成功!"; return(Json(result)); }
// Use this for initialization void Start() { frontMenu = GetComponentInChildren <FrontMenu>(); if (frontMenu == null) { Debug.LogError("Front menu not found!"); } levelSelectionMenu = GetComponentInChildren <LevelSelectionMenu>(); if (levelSelectionMenu == null) { Debug.LogError("LevelSelectionMenu not found!"); } settings = GameObject.Find("Settings").GetComponent <Settings>(); if (settings == null) { Debug.LogError("Settings not found!"); } frontMenu.Show(); frontMenu.EGoToLevelSelection += LGoToLevelSelection; levelSelectionMenu.ELoadLevel += LLoadLevel; }