Ejemplo n.º 1
0
    void OnGUI()
    {
        if (guiLayer == null && GameManager.Inst.ServerConfig != "Assembly" && GameManager.Inst.ServerConfig != "MDONS" && Time.frameCount > awakeFrame)
        {
            guiLayer = this.gameObject.AddComponent <HTMLGuiLayer>();
        }

        if (GameManager.Inst.Initialized && GameManager.Inst.playerManager && Application.loadedLevel > 0 && Application.loadedLevelName != "Connection")
        {
            if (GameManager.Inst.LevelLoaded == GameManager.Level.AVATARSELECT && IsVisible(GUIVis.AVATARGUI))
            {
                customizeAvatarGui.DrawGUI(gutter, gutter);
            }
            else
            {
                DrawMenu();
                // DrawChatGUI();
                DrawTimer();
                DrawUserList();
                DrawInvisiblePathTimer();
                teleGui.DrawGUI(Screen.width - teleGui.width - teleGui.height, Screen.height - teleGui.height);
                // Draw console backlog
                if (IsVisible(GUIVis.CONSOLE) && GameManager.Inst.LevelLoaded != GameManager.Level.AVATARSELECT)
                {
                    consoleGui.DrawGUI();
                }
                if (IsVisible(GUIVis.REPLAYGUI))
                {
                    replayGUI.DrawGUI(0, 0);
                }
                devGUI.DrawGUI(gutter, 100);

                // Draw presenter tool, if active.
                if (presenterToolCollabBrowser && allowPresenterTool && (GameManager.Inst.LevelLoaded == GameManager.Level.ORIENT || GameManager.Inst.LevelLoaded == GameManager.Level.OFFICE))
                {
                    DrawPresenterTool();
                }
                else
                {
                    mouseInPresenterTool = false;
                }

                // Find Product Viewport Cam and set up buttons for it.
                GameObject productViewportCamGO = GameObject.Find("ProductViewportCam");
                if (productViewportCamGO)
                {
                    productViewportCam = productViewportCamGO.GetComponent <Camera>();
                }

                if (productViewportCam && !facilitatorCamsOn)
                {
                    DrawProductViewportControls();
                }
            }
        }

        // Debugging tool; shows a tooltip for whatever the mouse is pointing at.
        if (objectTooltips)
        {
            RaycastHit devTipRay = new RaycastHit();
            if (Physics.Raycast(Camera.main.ScreenPointToRay(Input.mousePosition), out devTipRay))
            {
                GUI.tooltip = devTipRay.collider.gameObject.name;
            }
        }


        DrawTooltip();

        // Fade in/out effect.
        if (fadeAlpha > 0f)
        {
            GUI.color = new Color(0f, 0f, 0f, fadeAlpha);
            GUI.DrawTexture(new Rect(-50f, -50f, Screen.width + 100f, Screen.height + 100f), whiteTex);
        }
    }