// Update is called once per frame
    void Update()
    {
        //testes do victor
        if (!on_mainmenu)
        {
            if (_GI.ShowingInventoryGUI || _GI.ShowingProfilesGUI || _GI.ShowingBacklogGUI || _GI.ShowingNotesGUI)
            {
                Time.timeScale = 0.0f;
            }

            /*
             * else if (Input.GetKeyUp(KeyCode.Escape)) {
             *      Debug.Log("PAUSE BUTTON PRESSED");
             *      Time.timeScale = 1.0f - Time.timeScale;
             *      paused = !paused;
             * }*/
            else if (paused)
            {
                Time.timeScale = 0.0f;
            }
            else
            {
                Time.timeScale = 1.0f;
            }
        }
        else
        {
            Time.timeScale = 1.0f;
        }

        if (fadingtoblack)
        {
            bool faded = _GI.FadeToBlack();
            if (faded)
            {
                fadingtoblack = false;
                if (pendingstart)
                {
                    if (init_scene == -1)
                    {
                        TransiteScene("CenaQuarto1", "initial_spot", init_spot);
                    }
                    else
                    {
                        TransiteScene(init_scene, "initial_spot", init_spot);
                        fadingtoclear = true;
                    }

                    if (init_music != -1)
                    {
                        playSound(init_music, 0);
                    }
                    if (init_anbient != -1)
                    {
                        playSound(init_anbient, 1);
                    }
                    pendingstart = false;
                    //fadingtoclear = true;
                }
            }
        }
        if (fadingtoclear)
        {
            bool faded = _GI.FadeToClear();
            if (faded)
            {
                fadingtoclear = false;
                if (pendingshowmenuGUI)
                {
                    _GI.ShowingQuickMenuGUI = true;
                }
            }
        }


        //Camera
        if (cam_move)
        {
            cam.transform.position = new Vector3(player.transform.position.x, player.transform.position.y + _GI.PlayerHeight, cam.transform.position.z);
        }
        //Inputs
        //if (Input.GetKeyDown (KeyCode.C))
        //{
        //	menu_button_press = true;
        //}
        //if (Input.GetKeyUp (KeyCode.C))
        //{
        //	menu_button_press = false;
        //}
        //Variaveis de controle
        //if (menu_button_press)
        //{
        //	if (!on_mainmenu)
        //	{
        //		if ((!show_menu_GUI)&&(!show_inventory_GUI))
        //		{
        //			show_menu_GUI = true;
        //			persona.lockplayer();
        //		}else
        //		{
        //			show_menu_GUI = false;
        //			show_inventory_GUI = false;
        //			persona.unlockplayer();
        //		}
        //		menu_button_press = false;
        //	}
        //}

        //if (Input.GetMouseButtonDown (1))
        //{
        //	rightmouse_pressed = true;
        //}
        //if (Input.GetMouseButtonUp (1))
        //{
        //	rightmouse_pressed = false;
        //}

        /*
         * if (rightmouse_pressed)
         * {
         *      if (!show_menu_GUI)
         *      {
         *              if (!show_inventory_GUI)
         *              {
         *                      QM_Appear = true;
         *                      show_menu_GUI = true;
         *              }
         *      }else
         *      {
         *              //show_menu_GUI = false;
         *              QM_Appear = false;
         *      }
         *      rightmouse_pressed = false;
         * }
         */
        //Dialogo
        _GI.displayDialogText();
    }