Exemplo n.º 1
0
    // 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);

            }

        }


    }
Exemplo n.º 2
0
 public void SwitchScreens(AppScreen a, AppScreen b)
 {
     if (a != null)
     {
         a.gameObject.SetActive(false);
     }
     if (b != null)
     {
         b.gameObject.SetActive(true);
     }
 }
Exemplo n.º 3
0
 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);
 }
Exemplo n.º 4
0
 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();
 }
Exemplo n.º 5
0
 public ScreenObjectInterceptor(AppScreen appScreen)
 {
     this.appScreen = appScreen;
 }
 public ScreenObjectInterceptor(AppScreen appScreen)
 {
     reflectedScreen = new ReflectedObject(appScreen);
 }
Exemplo n.º 7
0
 public ScreenObjectInterceptor(AppScreen appScreen)
 {
     reflectedScreen = new ReflectedObject(appScreen);
 }
Exemplo n.º 8
0
 public ScreenObjectInterceptor(AppScreen appScreen)
 {
     this.appScreen = appScreen;
 }
Exemplo n.º 9
0
 public void OpenNewLesson(LessonData data)
 {
     windows[windows.Count - 1].OnScreenClose();
     currentLesson = Instantiate(GetLessonPrefabByType(data.type), Vector3.zero, Quaternion.identity).GetComponent <AppScreen>();
     currentLesson.OnScreenOpen(data);
 }
Exemplo n.º 10
0
 public void CloseCurrentLesson()
 {
     currentLesson.OnScreenClose();
     currentLesson = null;
 }