void OnGUI()
    {    //Controls switching between Mouselook and interaction and sets the cursor icon
        if (Conversation.InConversation == true)
        {
            playerUW.XAxis.enabled    = false;
            playerUW.YAxis.enabled    = false;
            playerUW.MouseLookEnabled = false;
            Cursor.lockState          = CursorLockMode.None;
            CursorPosition.center     = Event.current.mousePosition;
            GUI.DrawTexture(CursorPosition, playerUW.CursorIcon);
            playerUW.MouseLookCursor.mainTexture = playerUW.CursorIconBlank;
        }
        else
        {
            if (Event.current.Equals(Event.KeyboardEvent("f")))
            {            //Toggle full screen.
                if (FullScreen == true)
                {
                    FullScreen = false;
                    //chains.EnableDisableControl("main_window",true);
                    anchor.side             = UIAnchor.Side.Left;
                    anchor.relativeOffset   = new Vector2(0.43f, 0.13f);
                    stretch.relativeSize    = new Vector2(0.55f, 0.57f);
                    playerUW.playerCam.rect = new Rect(0.163f, 0.335f, 0.54f, 0.572f);
                    playerUW.playerHud.main_window.enabled = true;
                    playerUW.playerHud.compass.MoveControlOffset(+0.1f, 0.0f);
                    for (int i = 0; i <= playerUW.playerHud.compass.NorthIndicators.GetUpperBound(0); i++)
                    {
                        GuiBase cn = playerUW.playerHud.compass.NorthIndicators[i].GetComponent <GuiBase>();
                        if (cn != null)
                        {
                            cn.MoveControlOffset(+0.1f, 0.0f);
                        }
                    }
                }
                else
                {
                    FullScreen = true;
                    //chains.EnableDisableControl("main_window",false);
                    anchor.side             = UIAnchor.Side.Center;
                    anchor.relativeOffset   = new Vector2(0.0f, 0.0f);
                    stretch.relativeSize    = new Vector2(1.0f, 1.0f);
                    playerUW.playerCam.rect = new Rect(0.0f, 0.0f, 1.0f, 1.0f);

                    playerUW.playerHud.main_window.enabled = false;
                    playerUW.playerHud.compass.MoveControlOffset(-0.1f, 0.0f);
                    for (int i = 0; i <= playerUW.playerHud.compass.NorthIndicators.GetUpperBound(0); i++)
                    {
                        GuiBase cn = playerUW.playerHud.compass.NorthIndicators[i].GetComponent <GuiBase>();
                        if (cn != null)
                        {
                            cn.MoveControlOffset(-0.1f, 0.0f);
                        }
                    }
                }
            }

            if (Event.current.Equals(Event.KeyboardEvent("e")))
            {
                if (playerUW.MouseLookEnabled == false)
                {
                    playerUW.YAxis.enabled    = true;
                    playerUW.XAxis.enabled    = true;
                    playerUW.MouseLookEnabled = true;
                    Cursor.lockState          = CursorLockMode.Locked;
                }
                else
                {
                    playerUW.XAxis.enabled    = false;
                    playerUW.YAxis.enabled    = false;
                    playerUW.MouseLookEnabled = false;
                    Cursor.lockState          = CursorLockMode.None;
                }
            }


            if (playerUW.MouseLookEnabled == true)
            {
                playerUW.MouseLookCursor.mainTexture = playerUW.CursorIcon;
            }
            else
            {
                CursorPosition.center = Event.current.mousePosition;
                GUI.DrawTexture(CursorPosition, playerUW.CursorIcon);
                playerUW.MouseLookCursor.mainTexture = playerUW.CursorIconBlank;
            }
        }
    }