Exemple #1
0
 // Base version of interact does nothing. Implement special interactions in
 // child classes as required (start animations, play audio files, spawn
 // objects, etc.)
 public virtual void interact()
 {
     // If specified, we play a narration or other sound effect when the journal is activated.
     if (playSecondarySoundOnInteract && soundToPlayOnInteract)
     {
         if (!hasPlayedOnce || soundPlaybackBehaviour == eInteractSoundPlaybackType.PLAY_EVERY_TIME)
         {
             if (showWithText)
             {
                 interactionManager.playSecondaryInteractionAudio(soundToPlayOnInteract, true, audioLogText);
                 hasPlayedOnce = true;
             }
             else
             {
                 interactionManager.playSecondaryInteractionAudio(soundToPlayOnInteract, false, "");
                 hasPlayedOnce = true;
             }
         }
     }
     else if (playSecondarySoundOnInteract && !soundToPlayOnInteract)
     {
         Debug.LogWarning("FPEInteractableBaseScript:: Interactable '" + gameObject.transform.name + "' has 'Play Secondary Sound On Interact' checked, but there is no 'Sound To Play On Interact' Audio Clip specified.");
     }
 }