using UnityEngine; public class DinoAmbientLoop : MonoBehaviour { public AudioSource ambientSource; public AudioClip ambientClip; public float volume = 0.35f; void Awake() { if (ambientSource == null) { ambientSource = gameObject.AddComponent(); ambientSource.loop = true; ambientSource.playOnAwake = false; ambientSource.spatialBlend = 0f; } } void Start() { if (ambientClip == null || ambientSource == null) return; ambientSource.clip = ambientClip; ambientSource.volume = Mathf.Clamp01(volume); ambientSource.Play(); } }