// Request to play the given AmbientClip public static void Play(AmbientClip clip) { GetLocal(); AmbientTrigger at = clip.bounds.gameObject.AddComponent <AmbientTrigger>(); at.ac = clip; }
void Start() { collider = GetComponent <Collider2D>(); player = GameObject.FindGameObjectWithTag("Player").GetComponent <Collider2D>(); if (ac == null) { ac = new AmbientClip(clipName, collider, rolloff); } }