Exemple #1
0
    // public Text testTxt;


    // Use this for initialization
    void Start()
    {
        GameObject tmpObj = GameObject.Find("UI_Infos");

        //if (tmpObj) info = tmpObj.GetComponent<infoUI> ();

        tmpObj = GameObject.Find("VoiceOver_Manager");
        if (tmpObj)
        {
            voiceOverManager = tmpObj.GetComponent <VoiceOver_Manager> ();
        }
    }
Exemple #2
0
    // Use this for initialization
    void Start()
    {
        camManager = GetComponent <focusCamEffect>();
        _conditionsToAccessThePuzzle = GetComponent <conditionsToAccessThePuzzle>();
        _actionsWhenPuzzleIsSolved   = GetComponent <actionsWhenPuzzleIsSolved>();

        GameObject tmpObj = GameObject.Find("VoiceOver_Manager");

        tmpObj = GameObject.Find("VoiceOver_Manager");
        if (tmpObj)
        {
            voiceOverManager = tmpObj.GetComponent <VoiceOver_Manager>();
        }
    }
Exemple #3
0
    // Use this for initialization
    void Start()
    {
        audioVarious = new audioVariousFunctions();

        GameObject tmpObj = GameObject.Find("UI_Infos");

        if (tmpObj)
        {
            info = tmpObj.GetComponent <infoUI> ();
        }

        _audio = GetComponent <AudioSource> ();

        if (checkFocusMode())
        {
            camManager = GetComponent <focusCamEffect> ();
        }

        //-> Rotation case
        if (movementType == 0)
        {
            hinge  = objPivot.GetComponent <HingeJoint> ();                                             // init hinge joint
            motor  = hinge.motor;
            limits = hinge.limits;

            doorInitialization();

            rb = objPivot.GetComponent <Rigidbody> ();
            rb.collisionDetectionMode = CollisionDetectionMode.Discrete;
            rb.isKinematic            = true;
        }

        //-> Translation Case
        if (movementType == 1)
        {
            rb = targetPos.GetComponent <Rigidbody> ();
            initAxisConstraints();
            rb.mass = _rbMass;
        }

        tmpObj = GameObject.Find("VoiceOver_Manager");
        if (tmpObj)
        {
            voiceOverManager = tmpObj.GetComponent <VoiceOver_Manager> ();
        }
    }
Exemple #4
0
    public bool initIngameGlobalManageVariables()
    {
        //Debug.Log("here Init");


        // LevelManager
        GameObject tmpObj = GameObject.Find("LevelManager");

        if (tmpObj)
        {
            _levelManager = tmpObj.GetComponent <LevelManager> ();
            saveAndLoadManager._levelManager = _levelManager;
        }

        // cameraViewer3D
        tmpObj = GameObject.Find("CamShowObject");
        if (tmpObj)
        {
            cameraViewer3D = tmpObj.GetComponent <investigationCam> ();
        }

        // canvasPlayerInfos
        tmpObj = GameObject.Find("Canvas_PlayerInfos");
        if (tmpObj)
        {
            canvasPlayerInfos = tmpObj.GetComponent <UIVariousFunctions> ();

            // Reticule
            tmpObj = GameObject.Find("Reticule");
            if (tmpObj)
            {
                if (!b_DesktopInputs)
                {               // Deactivate Reticule if Mobile input are used
                    tmpObj.SetActive(false);
                    reticule = null;
                }
                else
                {
                    tmpObj.SetActive(true);
                    reticule = tmpObj;
                }
            }

            tmpObj = GameObject.Find("ReticuleJoystick");
            if (tmpObj)
            {
                reticuleJoystick      = tmpObj;
                reticuleJoystickImage = reticuleJoystick.transform.GetChild(0);
                _joystickReticule     = reticuleJoystick.GetComponent <JoystickReticule>();

                if (!b_DesktopInputs && reticuleJoystickImage && reticuleJoystickImage.gameObject.activeSelf)
                {
                    reticuleJoystickImage.gameObject.SetActive(false);
                }
            }

            StartCoroutine(InitCanvasMenu());
        }



        // canvasMainMenu
        tmpObj = GameObject.Find("Canvas_MainMenu");
        if (tmpObj)
        {
            canvasMainMenu = tmpObj.GetComponent <Menu_Manager> ();
        }

        switchKeyboardJoystick();

        // canvasLoadingScreen
        tmpObj = GameObject.Find("Canvas_LoadingScreen");
        if (tmpObj)
        {
            canvasLoadingScreen = tmpObj.GetComponent <Menu_Manager> ();
        }

        // Game_ObjectReader
        tmpObj = GameObject.Find("Game_ObjectReaderConnect");
        if (tmpObj)
        {
            Game_ObjectReader = tmpObj.GetComponent <ObjectReaderConnect>().Game_ObjectReaderConnect.GetComponent <ingameMultiPageText> ();
        }

        // canvasMobileInputs
        GameObject tmpMobileCanvas = GameObject.Find("mobileCanvas");

        if (tmpMobileCanvas)
        {
            canvasMobileInputs = tmpMobileCanvas.GetComponent <canvasMobileConnect>().canvas_Mobile;
            if (b_DesktopInputs)
            {
                canvasMobileInputs.SetActive(false);
            }                                                                       // Deactivate Mobile canvas if Desktop input are used
            else
            {
                canvasMobileInputs.SetActive(true);
            }
        }

        lastUIButtonSelected = null;
        navigationButtonList.Clear();

        // Find the event System
        GameObject tmpEventSys = GameObject.Find("EventSystem");

        if (tmpEventSys)
        {
            eventSys = tmpEventSys.GetComponent <EventSystem> ();
        }

        // InitInputs

        initInputsValues();


        // inputListOfStringGamepad


        // audioMenu
        tmpObj = GameObject.Find("audioMenu");
        if (tmpObj)
        {
            audioMenu = tmpObj.GetComponent <AudioSource> ();
        }

        // audioMenuClips
        tmpObj = GameObject.Find("audioMenu");
        if (tmpObj)
        {
            audioMenuClips = tmpObj.GetComponent <audioMenuClipList> ();
        }


        // voiceOverManager
        tmpObj = GameObject.Find("VoiceOver_Manager");
        if (tmpObj)
        {
            voiceOverManager = tmpObj.GetComponent <VoiceOver_Manager> ();
        }



        currentPlayerDiaryList.Clear();
        currentPlayerInventoryList.Clear();
        currentPlayerInventoryObjectVisibleList.Clear();

        // Connect script mobileInputsFingerMovement to canvasMobileInputs
        if (GetComponent <mobileInputsFingerMovement> () && !b_DesktopInputs)
        {
            //Debug.Log ("Here Ok");
            if (canvasMobileInputs)
            {
                GetComponent <mobileInputsFingerMovement> ().m_Raycaster = canvasMobileInputs.GetComponent <GraphicRaycaster> ();
            }
            if (canvasPlayerInfos)
            {
                GetComponent <mobileInputsFingerMovement> ().listRaycaster[0] = canvasPlayerInfos.GetComponent <GraphicRaycaster> ();
            }
            if (canvasMobileInputs)
            {
                GetComponent <mobileInputsFingerMovement> ().listRaycaster[1] = canvasMobileInputs.GetComponent <GraphicRaycaster> ();
            }
            if (canvasMainMenu)
            {
                GetComponent <mobileInputsFingerMovement> ().listRaycaster[2] = canvasMainMenu.GetComponent <GraphicRaycaster> ();
            }
        }

        // currentPlayer
        b_bodyMovement = true;

        tmpObj = GameObject.Find("Character");
        if (tmpObj)
        {
            currentPlayer = tmpObj;
        }


        if (tmpMobileCanvas && tmpMobileCanvas.GetComponent <canvasMobileConnect> ())
        {
            tmpMobileCanvas.GetComponent <canvasMobileConnect>().initializedCanvasMobile();
        }

        gameObject.GetComponent <focusCamEffect> ().Init();



        // language Choice
        tmpObj = GameObject.Find("OptionsManager");
        if (tmpObj)
        {
            tmpObj.GetComponent <GameOptionsManager>().initData();
        }



        return(true);
    }