Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System.Collections;
- public class NarrationControl : MonoBehaviour {
- public AudioClip[] narrations;
- public void Play( string name )
- {
- foreach (var clip in narrations)
- {
- if (clip.name == name)
- {
- audio.clip = clip;
- audio.Play ();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement