public bool KeyOn() { #if SEQUENCER_PARANOIA Debug.LogFormat( Time.frameCount.ToString("X4") + " Sequencer.KeyOn: {0} {1}", emitter.name, emitter.patches[index] ? emitter.patches[index].name : "???"); #endif if (Randomizer.zeroToOne <= emitter.randomization.chance) { if (emitter.auxiliary.source) { if (!emitter.patches[index].hasTimings) { Synthesizer.KeyOn(emitter.patches[index], emitter.auxiliary.source, 0f, emitter.volume); } } else { var t = emitter.attachment.useListenerTransform ? Heartbeat.listenerTransform : emitter.attachment.transform ? emitter.attachment.transform : emitter.transform; var r = emitter.randomization.distance.GetRandomValue(); var p = Vector3.zero; if (!Mathf.Approximately(r, 0f)) { var a = Randomizer.plusMinusOne * Mathf.PI * 2f; r *= emitter.zone.radius; p.x = Mathf.Sin(a) * r; p.z = Mathf.Cos(a) * r; } float v; UpdateModVolume(out v, 1000f); keyHandle = Synthesizer.KeyOn(out looping, emitter.patches[index], t, p, 0f, emitter.volume, v); } } return(emitter.patches[index].GetCueInfo(out totalTime, out repeatCount) || looping); }
public void KeyOn(Animator a) { bool looping; handle = Synthesizer.KeyOn(out looping, patch, a.transform, offset, delay); }