// Update is called once per frame void Update() { //Phone animation coming on screen State animator.SetBool("in", outPar); //App animation state animator.SetInteger("app", appOrder); if (ableToUsePhone) { //Open phone when it is not out //Using middle mouse button //Disable movement, camera movement and pause if (Input.GetMouseButtonDown(2) && !outPar) { cameraMovement.enabled = false; playerMovement.enabled = false; pauseScript.abletoPause = false; Cursor.visible = true; Cursor.lockState = CursorLockMode.None; outPar = true; appOrder = -1; } //Close phone when it is out //Using middle mouse button //Enable movement, camera movement and pause else if (Input.GetMouseButtonDown(2) && outPar) { cameraMovement.enabled = true; playerMovement.enabled = true; pauseScript.abletoPause = true; Cursor.visible = false; Cursor.lockState = CursorLockMode.Locked; outPar = false; appOrder = 0; } //If no apps then close if (appOrder == 0) { MainScreen.SetActive(true); AppScreen.SetActive(false); } } }
public void SwitchScreens(AppScreen a, AppScreen b) { if (a != null) { a.gameObject.SetActive(false); } if (b != null) { b.gameObject.SetActive(true); } }
public void GoTo(AppScreen to) { if (previous_screens.Count > 0) { SwitchScreens(previous_screens[previous_screens.Count - 1], to); } else { SwitchScreens(null, to); } previous_screens.Add(to); }
public void OpenNewWindow(AppScreen window) { if (windows.Count > 0) { windows[windows.Count - 1].OnScreenClose(); } window = Instantiate(window.gameObject, mainCanvas.transform).GetComponent <AppScreen>(); windows.Add(window); window.transform.SetAsLastSibling(); window.OnScreenOpen(); ManageBackButton(); }
public ScreenObjectInterceptor(AppScreen appScreen) { this.appScreen = appScreen; }
public ScreenObjectInterceptor(AppScreen appScreen) { reflectedScreen = new ReflectedObject(appScreen); }
public void OpenNewLesson(LessonData data) { windows[windows.Count - 1].OnScreenClose(); currentLesson = Instantiate(GetLessonPrefabByType(data.type), Vector3.zero, Quaternion.identity).GetComponent <AppScreen>(); currentLesson.OnScreenOpen(data); }
public void CloseCurrentLesson() { currentLesson.OnScreenClose(); currentLesson = null; }