/// <summary> /// Performs initialization related to the audio manager. /// </summary> private void InitAudioManager() { eventAudioManager = EventAudioManager.Instance; if (eventAudioManager == null) { Debug.LogError("AudioManager is not initialized."); } }
/// <summary> /// Performs initialization related to the audio manager. /// </summary> private void InitAudioManager() { eventAudioManager = EventAudioManager.Instance; if (eventAudioManager == null) { Debug.LogError("Souvenir.cs expects an instance of AudioManager in the scene."); } }
private void Awake() { if (instance == null) { instance = this; } else { Destroy(gameObject); } audioSource = GetComponent <AudioSource>(); }
public void Start() { animationExecutor = GetComponent <AnimationExecutor>(); shownKeyFrame = AnimationExecutor.SaveKeyFrame(gameObject); hiddenKeyFrame = AnimationExecutor.SaveKeyFrame(gameObject); hiddenKeyFrame.LocalScale = Vector3.zero; disabledKeyFrame = AnimationExecutor.SaveKeyFrame(gameObject); disabledKeyFrame.LocalScale = Constants.DisabledScale; AnimationExecutor.ApplyKeyFrame(gameObject, hiddenKeyFrame); eventAudioManager = EventAudioManager.Instance; }
private void Start() { gazeObserver = GetComponent <GazeObserver>(); voiceCommands = new Dictionary <string, Action>(); eventAudioManager = EventAudioManager.Instance; planeMaterial = Resources.Load <Material>(Constants.ImagePlaneMaterial); if (planeMaterial == null) { Debug.LogError("Could not load the image plane material."); } presenterManager = FindObjectOfType <ActiveSouvenirManager>(); if (presenterManager == null) { Debug.LogError("This script expects a presenter manager component in the scene."); } if (photoArrangementPrefab == null) { photoArrangementPrefab = Resources.Load <GameObject>(Constants.PhotoArrangementPrefab); if (photoArrangementPrefab == null) { Debug.LogError("Could not load photo arrangement prefab."); } } if (photoArrangementPrefab != null) { photoArrangement = Instantiate(photoArrangementPrefab, transform); if (photoArrangement != null) { // We want the photo arrangement to be centered with the souvenir. photoArrangement.transform.localPosition = Vector3.zero; photoArrangement.transform.localEulerAngles = Vector3.zero; photoCoordinates = TagsHelper.FindChildrenWithTag(photoArrangement, TagsHelper.ArrangementPictureCoords); photoNavigator = TagsHelper.FindChildWithTag(photoArrangement, TagsHelper.PhotoNavigator); loadingIcon = TagsHelper.FindChildWithTag(photoArrangement, Constants.LoadingIcon); numberOfPresenters = Math.Min(Constants.MaxNumberOfPresenters, photoCoordinates.Count); } else { Debug.LogError("Could not instantiate the photo arrangement prefab."); } } CreatePresenters(); BindPhotoNavigator(); if (Souvenir != null) { carousel.transform.parent = Souvenir.transform; Souvenir.ActiveStateEnabled += EnableGridState; Souvenir.ActiveStateDisabled += EnableCarouselState; Souvenir.PassiveStateEnabled += EnableCarouselState; Souvenir.PassiveStateDisabled += EnableSleepingState; } isInContentTransition = true; }