private void Start() { // Make sure we have all the components in the scene we need. anchorManager = WorldAnchorManager.Instance; if (anchorManager == null) { Debug.LogError("This script expects that you have a WorldAnchorManager component in your scene."); } spatialMappingManager = SpatialMappingManager.Instance; if (spatialMappingManager == null) { Debug.LogError("This script expects that you have a SpatialMappingManager component in your scene."); } if (anchorManager != null && spatialMappingManager != null) { anchorManager.AttachAnchor(this.gameObject, SavedAnchorFriendlyName); } else { // If we don't have what we need to proceed, we may as well remove ourselves. Destroy(this); } ttsMgr = GetComponent <TextToSpeechManager>(); if (ttsMgr == null) { Debug.LogError("TextToSpeechManager Required"); } }
private void Awake() { ttsManager = this.GetComponent <TextToSpeechManager>(); audioSource = this.GetComponent <UnityEngine.AudioSource>(); ttsManager.AudioSource = audioSource; }