/// <summary> /// Hàm thay đổi màn hình /// </summary> /// <param name="screenID">ID của màn hình</param> public static void ChangeScreen(ScreenID screenID) { //Nếu màn hình muốn thay đổi chính là màn hình hiện tại thỉ bỏ qua if (GetCurrentScreen() == screenID) { return; } //Lấy ra tên của màn hình string screenName = GetScreenName(screenID); //Lấy ra handle của màn hình UserControl userControl = GetIntanceScreen(screenID); //Lấy ra form main hiện hành MainStudent mainStudent = Program.MainForm as MainStudent; if (mainStudent != null) { //Thay đổi màn hình mainStudent.ChangeControlOfPanel(userControl); //Thông báo đến cho các màn hình khác là có sự thay đổi màn hình SendInternalEvent(new GuiEventID() { ID = GuiEventID.EventID.ChangeScreen }, screenName); } }
protected virtual void OnReset(ScreenID screenId) { if (GetScreenID() != screenId) { return; } }
protected override void OnReset(ScreenID screenId) { base.OnReset(screenId); _userActionsVO.boost = false; _toggleBoost.isOn = false; _userActionsVO.direction = 0; _tgDirection.SetAllTogglesOff(); }
public void ActivateScreen(ScreenID screen, object[] optionalParams = null) { if (screen != CurrentScreen) { AllScreens[CurrentScreen].Deactivate(); AllScreens[screen].Activate(optionalParams); CurrentScreen = screen; } }
public void ShowScreenHandler(ScreenID screenId) { if (GetScreenID() != screenId) { return; } view.enabled = true; }
public void HideScreenHandler(ScreenID screenId) { if (GetScreenID() != screenId) { return; } view.enabled = false; }
public void Execute() { previousScreen = screenDirector.currentScreen; screenDirector.HideScreen(previousScreen); screenDirector.ShowScreen(ScreenID.Tutorial); screenDirector.ShowScreen(ScreenID.StartConversation); playerController.isActive = true; }
/// <summary> Изменить экран. </summary> /// <param name="screenID"> ID экрана. </param> public static void ChangeScreen(ScreenID screenID) { if (screens[currentScreenID].WasLoad) screens[currentScreenID].Unload( ); currentScreenID = (int)screenID; if (!screens[currentScreenID].WasLoad) screens[currentScreenID].Load( ); }
public void Execute() { previousScreen = screenDirector.currentScreen; screenDirector.HideScreen(previousScreen); screenDirector.ShowScreen(ScreenID.Conversation); screenDirector.HideScreen(ScreenID.StartConversation); playerController.isActive = false; playerController.NpcInteraction(); }
public void SetCurrentScreen(ScreenID screenId) { gameScreens[currentScreen].Hide(); currentScreen = screenId; if (currentScreen == ScreenID.GameScreen) { player.SetActive(true); } gameScreens[currentScreen].Show(); }
public void Hidecreen(ScreenID screenID) { try { loadedScreens[screenID].Hide(); }catch { //this screen is not loaded return; } }
public void ShowScreen(ScreenID screenID) { try { loadedScreens[screenID].Show(); }catch { //this screen is not loaded return; } }
// TODO: Stub. #endregion #region Accessor Methods /// <summary> /// Get IScreen returns the screen at the specified ID. /// </summary> /// <param name="id">Desired IScreen's ID.</param> /// <returns>Returns IScreen associated with the input ID, if it exists.</returns> public IScreen GetScreen(ScreenID id) { if (m_screens != null && m_screens.ContainsKey(id)) { return(m_screens[id]); } else { throw new ArgumentOutOfRangeException("Index was out of range of the list of screens"); } }
public void Init() { textFieldsDisctionary = new Dictionary<string, TextMeshProUGUI>(); id = ScreenID.LobbyScreen; foreach(TextMeshProUGUI tmp in textFields) { textFieldsDisctionary.Add(tmp.gameObject.name, tmp); } Hide(); }
private IScreen GetScreen(ScreenID id) { foreach (IScreen screen in screens) { if (screen.GetID() == id) { return(screen); } } return(null); }
private void CheckGameState() { if (playerModel.hasWon) { gameScreens[currentScreen].Hide(); currentScreen = ScreenID.CreditsScreen; gameScreens[currentScreen].Show(); } if (playerModel.hasLost) { gameScreens[currentScreen].Hide(); currentScreen = ScreenID.GameOverScreen; gameScreens[currentScreen].Show(); player.SetActive(false); } }
/// <summary> /// Hàm lấy ra handle của screen /// </summary> /// <param name="screenID">ScreenID tương ứng</param> /// <returns>Handle của screenID</returns> private static UserControl GetIntanceScreen(ScreenID screenID) { UserControl intance = null; switch (screenID) { case ScreenID.SinhVienThucTapScreen: intance = new SinhVienThucTap(); break; case ScreenID.GiaoVienHuongDanScreen: intance = new GiaoVienHuongDan(); break; case ScreenID.DeTaiThucTapScreen: intance = new DeTaiThucTap(); break; case ScreenID.DangKyDeTaiScreen: intance = new DangKyDeTai(); break; case ScreenID.HuyDeTaiDangKyScreen: intance = new HuyDeTaiDangKy(); break; case ScreenID.BangDiemScreen: intance = new BangDiem(); break; case ScreenID.BaoCaoThongKeScreen: intance = new BaoCaoThongKe(); break; case ScreenID.TroGiupScreen: intance = new TroGiup(); break; default: throw new ArgumentOutOfRangeException(_SCREEN_ID_NOT_FOUND); } return(intance); }
/// <summary> /// Hàm lấy tên của màn hình thông qua ID /// </summary> /// <param name="screenID">ScreenID của màn hình</param> /// <returns>Tên màn hình</returns> public static string GetScreenName(ScreenID screenID) { string str = ""; switch (screenID) { case ScreenID.SinhVienThucTapScreen: str = @"Quản lý sinh viên thực tập"; break; case ScreenID.GiaoVienHuongDanScreen: str = @"Quản lý giáo viên hướng dẫn"; break; case ScreenID.DeTaiThucTapScreen: str = @"Quản lý đề tài thực tập"; break; case ScreenID.DangKyDeTaiScreen: str = @"Quản lý đăng ký đề tài thực tập"; break; case ScreenID.HuyDeTaiDangKyScreen: str = @"Quản lý hủy đề tài đăng ký"; break; case ScreenID.BangDiemScreen: str = @"Quản lý bảng điểm"; break; case ScreenID.BaoCaoThongKeScreen: str = @"Quản lý báo cáo thống kê"; break; case ScreenID.TroGiupScreen: str = @"Trợ giúp"; break; default: throw new ArgumentOutOfRangeException(_SCREEN_ID_NOT_FOUND); } return(str); }
private void Init() { playerModel = new PlayerModel(); currentLevel = playerModel.Level; gameScreens = new Dictionary <ScreenID, IScreen>(); cmdDictionary = new Dictionary <string, ICommand>(); playerMovement = player.GetComponent <PlayerMovement>(); playerMovement.Init(playerModel); LoadScreens(); currentScreen = ScreenID.StartScreen; if (poolable != null) { LoadPlayerCollectCommands(); BuildPool(); } LoadCmds(); gameScreens[currentScreen].Show(); toggelHelp.onClick.AddListener(ToggelHelpButton); }
public void ResetScreen(ScreenID screenId) { Messenger <ScreenID> .Broadcast(ViewEvent.RESET_SCREEN, screenId); }
private void SetScreenActive(ScreenID screenID) { //Get corresponding int value from given screenID. int _screenID = (int)screenID; //Loop through menu screens and set screen active if a match is found foreach (int i in Enum.GetValues(typeof(ScreenID))) { if (i == _screenID) _screens[i].SetActive(true); else _screens[i].SetActive(false); }//foreach }
protected override void OnReset(ScreenID screenId) { base.OnReset(screenId); _tfLabel.text = ""; }
public IScreen GetScreen(ScreenID id) { return(loadedScreens[id]); }
// TODO: Stub. #endregion #region Accessor Methods /// <summary> /// Get IScreen returns the screen at the specified index. Since this is not the StateManager this method will not be needed. /// </summary> /// <param name="id">IScreen ID associated with desired IScreen object.</param> /// <returns></returns> public IScreen GetScreen(ScreenID id) { // TODO: Stub. return(null); }
public Screen BuildScreen(ScreenID screenID) { return(null); }
public void ResetScreen(ScreenID screenID) { screensManager.ResetScreen(screenID); }
public void HideScreen(ScreenID screenID) { screensManager.HideScreen(screenID); }
public void HideScreen(ScreenID screenID) { loadedScreens[screenID].Hide(); }
private void SetCurrentScreenIDAndState(ScreenID _screenID, ScreenState _screenState) { currentScreenID = _screenID; currentScreenState = _screenState; }
private Screen FindScreen(ScreenID id) { return FindScreen((int)id); }
////////////////////////////////////////////////////////////////////////////// #region Helpers private Screen FindScreen(ScreenID id) { return(FindScreen((int)id)); }
public void ShowScreen(ScreenID screenID) { screensManager.ShowScreen(screenID); }
public void ShowScreen(ScreenID screenID) { loadedScreens[screenID].Show(); currentScreen = screenID; }