Exemple #1
0
        // Update is called once per frame
        void Update()
        {
            if (canvas.worldCamera == null)
            {
                assignUICamera(canvas, trinusProcessor.getUICamera());
            }

            if (trinusCursor != null && trinusCursor.gameObject.activeSelf)              //hack to correctly place the cursor in stereoscopic mode
            {
                updateTrinusCursor();
            }
            if (currentPage == UI_PAGE.CONNECTION_WAIT && trinusProcessor.isStreaming())
            {
                if (connectedEvent != null)
                {
                    connectedEvent.Invoke();
                }
                openGame();
            }
            else
            if (currentPage != UI_PAGE.NONE && trinusProcessor.getStatus() == corelib.util.DataStructs.STATUS.DISCONNECTED)
            {
                if (disconnectedEvent != null)
                {
                    currentPage = UI_PAGE.NONE;
                    disconnectedEvent.Invoke();
                }
                else
                {
                    startConnection();
                }
            }
        }
Exemple #2
0
        public void setCurrentPage(UI_PAGE page)
        {
            hideUIPages();
            currentPage       = page;
            currentPageObject = null;
            setTrinusCursor(false);

            Camera mainCam = trinusProcessor.getMainCamera();

            if (mainCam != null)
            {
                Rect camRect = mainCam.rect;
                transform.localScale = new Vector3(trinusUIDefaultScale * camRect.width / 1f, transform.localScale.y, transform.localScale.z);
            }

            if (customUI != null)
            {
                customUI.gameObject.SetActive(false);
            }

            switch (page)
            {
            case UI_PAGE.INTRO:
                if (introPages != null && currentIntroStage < introPages.Length)
                {
                    introPages [currentIntroStage].gameObject.SetActive(true);
                    currentPageObject = introPages [currentIntroStage].gameObject;
                    if (EventSystem.current != null && getCurrentPageChild("ContinueButton"))
                    {
                        EventSystem.current.SetSelectedGameObject(getCurrentPageChild("ContinueButton").gameObject, null);
                    }
                    setTrinusCursor(true);
                }
                break;

            case UI_PAGE.CONNECTION_WAIT:
                if (connectingPage != null)
                {
                    connectingPage.gameObject.SetActive(true);
                    currentPageObject = connectingPage.gameObject;
                    setTrinusCursor(true);
                }
                break;

            case UI_PAGE.GAME:
                if (gamePage != null)
                {
                    gamePage.gameObject.SetActive(true);
                    currentPageObject = gamePage.gameObject;
                }
                break;

            case UI_PAGE.SETTINGS:
                if (mainSettingsPage != null)
                {
                    mainSettingsPage.gameObject.SetActive(true);
                    currentPageObject = mainSettingsPage.gameObject;

                    if (EventSystem.current != null && getCurrentPageChild("FpsToggle"))
                    {
                        EventSystem.current.SetSelectedGameObject(getCurrentPageChild("FpsToggle").gameObject, null);
                    }
                    setTrinusCursor(true);
                }
                break;

            case UI_PAGE.LENS:
                if (lensSettingsPage != null)
                {
                    lensSettingsPage.gameObject.SetActive(true);
                    currentPageObject = lensSettingsPage.gameObject;

                    if (EventSystem.current != null && getCurrentPageChild("SeparationSlider"))
                    {
                        EventSystem.current.SetSelectedGameObject(getCurrentPageChild("SeparationSlider").gameObject, null);
                    }
                    setTrinusCursor(true);
                }
                break;
            }
        }
Exemple #3
0
 public void hide(UI_PAGE page)
 {
     this.ui_objects[page].SetActive(false);
 }
Exemple #4
0
 public void show(UI_PAGE page)
 {
     this.ui_objects[page].SetActive(true);
 }
Exemple #5
0
 public GameObject get_uipage(UI_PAGE page)
 {
     return(this.ui_objects[page]);
 }
Exemple #6
0
 public void show_fade_out_in(UI_PAGE prev_page, UI_PAGE next_page, DefaultDelegate finished_callback = null)
 {
     get_uipage(UI_PAGE.FADE_OUT_IN).GetComponent <CFadeOutIn>().update_ui_page(
         prev_page, next_page, finished_callback);
     CUIManager.Instance.show(UI_PAGE.FADE_OUT_IN);
 }
Exemple #7
0
 public void update_ui_page(UI_PAGE prev_page, UI_PAGE next_page, DefaultDelegate finished_callback)
 {
     this.prev_ui_page      = prev_page;
     this.next_ui_page      = next_page;
     this.finished_callback = finished_callback;
 }