Пример #1
0
//--> Launch a new Voice Over
    private void newVoiceOver()
    {
        TextProperties textProperties = gameObject.GetComponent <TextProperties> ();

        //-> Add the entry in the diary if needed
        int  managerID      = textProperties.managerID;
        bool alreadyInDiary = false;

        if (textProperties.textList.r_Available(0, managerID))
        {
            for (var i = 0; i < ingameGlobalManager.instance.currentPlayerDiaryList.Count; i++)
            {
                if (textProperties.managerID == ingameGlobalManager.instance.currentPlayerDiaryList [i])
                {
                    alreadyInDiary = true;
                    break;
                }
            }
            if (!alreadyInDiary)
            {
                ingameGlobalManager.instance.currentPlayerDiaryList.Add(managerID);
            }
        }

        if (textProperties)
        {
            if (voiceOverManager)
            {
                voiceOverManager.setupNewVoice(
                    textProperties.r_TextList(),
                    textProperties.t_Language,
                    textProperties.managerID,
                    textProperties.r_TextList().voiceOverDescription(textProperties.t_Language, textProperties.managerID),
                    textProperties.r_TextList().r_audioPriority(textProperties.t_Language, textProperties.managerID),
                    alreadyInDiary);
            }
        }
    }
Пример #2
0
    // Update is called once per frame
    void Update()
    {
        if (ingameGlobalManager.instance.b_InputIsActivated)
        {
            if (_conditionsToAccessThePuzzle.b_PuzzleIsActivated && !ingameGlobalManager.instance.b_Ingame_Pause)
            {
                if (iconPosition.activeInHierarchy && ingameGlobalManager.instance.currentPuzzle == _conditionsToAccessThePuzzle)
                {
                    iconPosition.SetActive(false);
                    displayUIInfo(ingameGlobalManager.instance.currentFeedback.diaryList[ingameGlobalManager.instance.currentLanguage]._languageSlot[feedbackIDList[0].ID].diaryTitle[0]);

                    if (voiceOverManager && b_VoiceOverActivated && !alreadyPlayed)
                    {
                        alreadyPlayed = true;
                        // Debug.Log("Play Voice");
                        voiceOverManager.setupNewVoice(
                            ingameGlobalManager.instance.currentDiary,
                            ingameGlobalManager.instance.currentLanguage,
                            diaryIDList[0].ID,
                            ingameGlobalManager.instance.currentDiary.voiceOverDescription(
                                ingameGlobalManager.instance.currentLanguage,
                                diaryIDList[0].ID),
                            ingameGlobalManager.instance.currentDiary.r_audioPriority(
                                ingameGlobalManager.instance.currentLanguage,
                                diaryIDList[0].ID),
                            true);
                    }
                }

                PuzzleBehaviour();
            }
            if (!iconPosition.activeInHierarchy && ingameGlobalManager.instance.currentPuzzle == null)
            {
                iconPosition.SetActive(true);
                displayUIInfo("");
            }
        }
    }
Пример #3
0
//--> This function is called to rotate or translate an object
    public void MoveObject()
    {
        //-> Object is unlocked
        if (callMethods.Call_A_Method_Only_Boolean(methodsList) &&  // Check if all the custom methods return true
            checkIfGameobjectsInTheListAreActivated() &&            // check if needed object are activated in the scene
            checkNeededObjectsInTheInventory()                      // check if needed object is in the inventory
            ||
            ingameGlobalManager.instance._D                         // Debug Mode Activated
            )
        {
            DeactivateObjectInTheInvenetoryViewer();

            StopAllCoroutines();
            if (checkFocusMode() && camManager != null)                                         // Check if Focus Mode is activated

            {
                if (!ingameGlobalManager.instance.b_focusModeIsActivated)
                {
                    ingameGlobalManager.instance.FocusIsActivated(gameObject);

                    camManager.MoveCameraToFocusPosition(camManager.targetFocusCamera, true);
                }
                else
                {
                    camManager.MoveCameraToDefaultPosition();
                }
            }

            //-> Play one time Unlock options custom editor section 6
            if (!b_unlocked)
            {
                //-> Play Voice Over
                if (voiceOverManager && b_VoiceOverActivatedUnlocked && howManyTimeVoiceOverWasPlayed == 0)
                {
                    //Debug.Log ("Play Voice");
                    voiceOverManager.setupNewVoice(
                        ingameGlobalManager.instance.currentDiary,
                        ingameGlobalManager.instance.currentLanguage,
                        diaryIDListUnlock [0].ID,
                        ingameGlobalManager.instance.currentDiary.voiceOverDescription(
                            ingameGlobalManager.instance.currentLanguage,
                            diaryIDListUnlock [0].ID),
                        ingameGlobalManager.instance.currentDiary.r_audioPriority(
                            ingameGlobalManager.instance.currentLanguage,
                            diaryIDListUnlock [0].ID),
                        true);
                }

                //-> Display feedback
                if (info && b_feedbackActivatedUnlock)
                {
                    bool b_Exist = false;
                    for (var i = 0; i < info.listRefGameObject.Count; i++)
                    {
                        if (gameObject == info.listRefGameObject [i])
                        {
                            b_Exist = true;
                        }
                    }
                    if (!b_Exist)
                    {
                        info.playAnimInfo(ingameGlobalManager.instance.currentFeedback.diaryList [ingameGlobalManager.instance.currentLanguage]._languageSlot [feedbackIDListUnlock[0].ID].diaryTitle[0], "Feedback", gameObject);
                    }
                }

                //-> Play unLock sound Fx
                if (_audio && a_Unlocked)
                {
                    //Debug.Log ("Here");
                    audioVarious.prepareAudio(_audio, a_UnlockedVolume, .2f, a_Unlocked);   // Prepare Audio before playing sound
                    _audio.Play();
                }
                b_unlocked = true;
            }

            //-> Start Rotate object
            if (movementType == 0)
            {
                StartCoroutine(I_Rotate());
            }
            //-> Start translate
            if (movementType == 1)
            {
                StartCoroutine(I_Translate());
            }
        }
        //-> Object is locked
        else
        {
            //-> Display feedback
            if (info && b_feedbackActivated)
            {
                bool b_Exist = false;
                for (var i = 0; i < info.listRefGameObject.Count; i++)
                {
                    if (gameObject == info.listRefGameObject [i])
                    {
                        b_Exist = true;
                    }
                }
                if (!b_Exist)
                {
                    info.playAnimInfo(ingameGlobalManager.instance.currentFeedback.diaryList [ingameGlobalManager.instance.currentLanguage]._languageSlot [feedbackIDList[0].ID].diaryTitle[0], "Feedback", gameObject);
                }
            }
            //-> Play Voice Over
            if (voiceOverManager && b_VoiceOverActivated && howManyTimeVoiceOverWasPlayed == 0)
            {
                if (b_playVoiceOverOnlyOneTime)
                {
                    howManyTimeVoiceOverWasPlayed++;
                }

                voiceOverManager.setupNewVoice(
                    ingameGlobalManager.instance.currentDiary,
                    ingameGlobalManager.instance.currentLanguage,
                    diaryIDList[0].ID,
                    ingameGlobalManager.instance.currentDiary.voiceOverDescription(
                        ingameGlobalManager.instance.currentLanguage,
                        diaryIDList[0].ID),
                    ingameGlobalManager.instance.currentDiary.r_audioPriority(
                        ingameGlobalManager.instance.currentLanguage,
                        diaryIDList[0].ID),
                    true);
            }

            //-> Play Lock sound Fx
            if (_audio && a_Locked)
            {
                audioVarious.prepareAudio(_audio, a_LockedVolume, .2f, a_Locked);   // Prepare Audio before playing sound
                _audio.Play();
            }
        }
    }