// Update is called once per frame void Update() { if (Input.GetKeyUp(advancer)) { Planeverb.PlaneverbEmitter next = orderedCues[cueIndex++]; next.Emit(); } }
public PlaneverbAudioSource Play(AudioClip clip, int id, PlaneverbEmitter emitter, bool loop) { if (clip) { // make a new source to be played next audio frame GameObject newSource = Instantiate(sourceTemplate); PlaneverbAudioSource newComp = newSource.GetComponent <PlaneverbAudioSource>(); // set information on new object newComp.SetClip(clip); newComp.SetEmitter(emitter); newComp.SetManager(gameObject); newComp.SetLoop(loop); // add it as a child newSource.transform.SetParent(transform); return(newComp); } else { return(null); } }
// set handle to the emitter this is playing from public void SetEmitter(PlaneverbEmitter e) { emitter = e; }