Exemplo n.º 1
0
    public void HideMainMenu()
    {
        if (ingameGlobalManager.instance.canvasMobileInputs &&
            !ingameGlobalManager.instance.canvasMobileInputs.activeSelf &&
            !ingameGlobalManager.instance.b_DesktopInputs)
        {
            ingameGlobalManager.instance.canvasMobileInputs.SetActive(true);
        }

        GameObject mainMenuManager = GameObject.Find("MainMenuManager");

        if (mainMenuManager)
        {
            if (mainMenuManager.GetComponent <MainMenu> ().txtValidation)
            {
                mainMenuManager.GetComponent <MainMenu> ().txtValidation.text = "";
            }
        }

        ingameGlobalManager.instance.canvasPlayerInfos.gameObject.SetActive(true);


        //--> Display available actions on screen
        ingameGlobalManager.instance.canvasPlayerInfos.displayAvailableActionOnScreen(false, "MainMenu");


        ingameGlobalManager gManager = ingameGlobalManager.instance;

        gManager.StartCoroutine(gManager.changeLockStateLock());
        gManager.b_AllowCharacterMovment = true;
        if (gManager.reticule && !gManager.reticule.activeSelf && gManager.b_DesktopInputs)
        {
            gManager.reticule.SetActive(true);
        }


        gManager.navigationList.RemoveAt(gManager.navigationList.Count - 1);

        // Deactivate mouse cursor if gamepad is selected
        if (gManager.b_Joystick &&
            gManager.b_DesktopInputs &&
            Cursor.visible)
        {
            Cursor.visible = false;
            gManager.canvasMainMenu.GetComponent <GraphicRaycaster>().enabled = false;
        }


        for (var i = 0; i < gManager.canvasMainMenu.List_GroupCanvas.Count; i++)
        {
            if (gManager.canvasMainMenu.List_GroupCanvas [i].name == "Game")
            {
                gManager.canvasMainMenu.GoToOtherPage(gManager.canvasMainMenu.List_GroupCanvas [i]);
                break;
            }
        }

        if (!gManager.canvasPlayerInfos.gameObject.activeSelf)
        {
            gManager.canvasPlayerInfos.gameObject.SetActive(true);
        }
        gManager.canvasPlayerInfos.activateIcons();

        gManager.audioMenuClips.playASound(0);                                                          // Play sound (Hierarchy : ingameGlobalManager -> audioMenu)


        ingameGlobalManager.instance.eventSys.GetComponent <EventSystem> ().SetSelectedGameObject(null);

        ingameGlobalManager.instance.onlyUnPauseGame();
    }
Exemplo n.º 2
0
//--> Hide Diary (go back to game)
    public void HideDiary()
    {
        ingameGlobalManager gManager = ingameGlobalManager.instance;


        gManager.onlyUnPauseGame();

        if (ingameGlobalManager.instance.canvasPlayerInfos)
        {
            ingameGlobalManager.instance.canvasPlayerInfos.gameObject.SetActive(true);
        }

        if (ingameGlobalManager.instance.canvasMobileInputs &&
            !ingameGlobalManager.instance.canvasMobileInputs.activeSelf &&
            !ingameGlobalManager.instance.b_DesktopInputs)
        {
            ingameGlobalManager.instance.canvasMobileInputs.SetActive(true);
        }

        gManager.canvasMainMenu.GoToOtherPage(canvasGame);
        gManager.navigationList.RemoveAt(gManager.navigationList.Count - 1);

        if (gManager.navigationList.Count > 0 && gManager.navigationList [gManager.navigationList.Count - 1] == "Focus")
        {
            //Debug.Log("Here");
            //Cursor.visible = true;
            gManager.b_currentCursorVisibility = Cursor.visible;

            if (gManager.reticule && gManager.reticule.activeSelf && gManager.b_DesktopInputs)
            {
                gManager.StartCoroutine(gManager.changeLockStateConfined(true));
                gManager.b_AllowCharacterMovment = false;
                gManager.reticule.SetActive(false);
            }


            if (gManager.reticule && gManager.reticule.activeSelf && gManager.b_DesktopInputs)
            {
                gManager.reticule.SetActive(false);
            }

            if (gManager.reticuleJoystickImage &&
                ingameGlobalManager.instance.currentPuzzle &&
                !ingameGlobalManager.instance.currentPuzzle.GetComponent <focusOnly>() &&
                ingameGlobalManager.instance.b_Joystick)
            {
                if (!ingameGlobalManager.instance.canvasPlayerInfos.b_rememberLastState)
                {
                    gManager.reticuleJoystickImage.gameObject.SetActive(true);
                }
                else
                {
                    gManager.reticuleJoystickImage.gameObject.SetActive(false);
                }
            }
            //-> Focus in a wardrobe or drawer
            else if (ingameGlobalManager.instance.currentobjTranslateRotate != null &&
                     ingameGlobalManager.instance.b_DesktopInputs &&
                     ingameGlobalManager.instance.b_Joystick)
            {
                gManager._joystickReticule.newPosition(Screen.width / 2, Screen.height / 2);
                gManager.reticuleJoystickImage.gameObject.SetActive(true);
            }
            else
            {
                //Debug.Log("Here 2");
                gManager.reticuleJoystickImage.gameObject.SetActive(false);
            }

            //--> Display available actions on screen
            //ingameGlobalManager.instance.canvasPlayerInfos.displayAvailableActionOnScreen (false, true);
            ingameGlobalManager.instance.canvasMainMenu.GetComponent <iconsInfoInputs>().displayAvailableActionOnScreen(false, true);
        }
        else
        {
            Cursor.visible = true;
            gManager.b_currentCursorVisibility = Cursor.visible;
            gManager.StartCoroutine(gManager.changeLockStateLock());
            gManager.b_AllowCharacterMovment = true;
            if (gManager.reticule && !gManager.reticule.activeSelf && gManager.b_DesktopInputs)
            {
                gManager.reticule.SetActive(true);
            }

            if (gManager.reticuleJoystickImage && gManager.reticuleJoystickImage.gameObject.activeSelf)
            {
                gManager.reticuleJoystickImage.gameObject.SetActive(true);
            }

            //--> Display available actions on screen
            //ingameGlobalManager.instance.canvasPlayerInfos.displayAvailableActionOnScreen (false, false);
            ingameGlobalManager.instance.canvasMainMenu.GetComponent <iconsInfoInputs>().displayAvailableActionOnScreen(false, false);
        }

        if (!gManager.canvasPlayerInfos.gameObject.activeSelf)
        {
            gManager.canvasPlayerInfos.gameObject.SetActive(true);
        }

        gManager.canvasPlayerInfos.activateIcons();

        gManager.audioMenuClips.playASound(0);                                                          // Play sound (Hierarchy : ingameGlobalManager -> audioMenu)

        //gManager.canvasPlayerInfos.displayAvailableActionOnScreen(false, false);
        ingameGlobalManager.instance.canvasMainMenu.GetComponent <iconsInfoInputs>().displayAvailableActionOnScreen(false, false);
        if (nextPageReader)
        {
            nextPageReader.SetActive(false);
        }
        if (lastPageReader)
        {
            lastPageReader.SetActive(false);
        }


        ingameGlobalManager.instance.canvasPlayerInfos.activateObjTitle();
        ingameGlobalManager.instance.canvasPlayerInfos.activateObjPuzzleNotAvailable();
        ingameGlobalManager.instance.canvasPlayerInfos.activateObjResetPuzzle();
        ingameGlobalManager.instance.voiceOverManager.activateObSubtitle();
    }
Exemplo n.º 3
0
    private void GoBackFromInventoryToGame()
    {
        if (ingameGlobalManager.instance.canvasMobileInputs &&
            !ingameGlobalManager.instance.canvasMobileInputs.activeSelf &&
            !ingameGlobalManager.instance.b_DesktopInputs)
        {
            ingameGlobalManager.instance.canvasMobileInputs.SetActive(true);
        }

        ingameGlobalManager gManager = ingameGlobalManager.instance;

        gManager.navigationList.RemoveAt(gManager.navigationList.Count - 1);

        for (var i = 0; i < gManager.canvasMainMenu.List_GroupCanvas.Count; i++)
        {
            if (gManager.canvasMainMenu.List_GroupCanvas [i].name == "Game")
            {
                gManager.canvasMainMenu.GoToOtherPage(gManager.canvasMainMenu.List_GroupCanvas [i]);
                break;
            }
        }

        if (gManager.navigationList.Count > 0 && gManager.navigationList [gManager.navigationList.Count - 1] == "Focus")
        {
            //Cursor.visible = true;
            if (gManager.reticule && gManager.reticule.activeSelf && gManager.b_DesktopInputs)
            {
                gManager.b_currentCursorVisibility = Cursor.visible;
                gManager.StartCoroutine(gManager.changeLockStateConfined(true));
            }



            gManager.b_AllowCharacterMovment = false;
            if (gManager.reticule && gManager.reticule.activeSelf && gManager.b_DesktopInputs)
            {
                gManager.reticule.SetActive(false);
            }
        }
        else
        {
            gManager.StartCoroutine(gManager.changeLockStateLock());
            gManager.b_AllowCharacterMovment = true;
            if (gManager.reticule && !gManager.reticule.activeSelf && gManager.b_DesktopInputs)
            {
                gManager.reticule.SetActive(true);
            }
        }



        if (!gManager.canvasPlayerInfos.gameObject.activeSelf)
        {
            gManager.canvasPlayerInfos.gameObject.SetActive(true);
        }

        gManager.canvasPlayerInfos.activateIcons();

        gManager.audioMenuClips.playASound(0);                                                          // Play sound (Hierarchy : ingameGlobalManager -> audioMenu)
        gManager.onlyUnPauseGame();
        ingameGlobalManager.instance.canvasMainMenu.GetComponent <iconsInfoInputs>().displayAvailableActionOnScreen(false, false);


        if (gManager.reticuleJoystickImage &&
            ingameGlobalManager.instance.currentPuzzle &&
            !ingameGlobalManager.instance.currentPuzzle.GetComponent <focusOnly>() &&
            ingameGlobalManager.instance.b_Joystick)
        {
            if (!ingameGlobalManager.instance.canvasPlayerInfos.b_rememberLastState)
            {
                gManager.reticuleJoystickImage.gameObject.SetActive(true);
            }
            else
            {
                gManager.reticuleJoystickImage.gameObject.SetActive(false);
            }
        }
        //-> Focus in a wardrobe or drawer
        else if (ingameGlobalManager.instance.currentobjTranslateRotate != null &&
                 ingameGlobalManager.instance.b_DesktopInputs &&
                 ingameGlobalManager.instance.b_Joystick)
        {
            gManager.reticuleJoystickImage.gameObject.SetActive(true);
        }
        else
        {
            gManager.reticuleJoystickImage.gameObject.SetActive(false);
        }

        ingameGlobalManager.instance.canvasPlayerInfos.activateObjTitle();
        ingameGlobalManager.instance.canvasPlayerInfos.activateObjPuzzleNotAvailable();
        ingameGlobalManager.instance.canvasPlayerInfos.activateObjResetPuzzle();
        ingameGlobalManager.instance.voiceOverManager.activateObSubtitle();
    }