public bool Activate( ActivationParams ap, Parameters.EnvelopeParams eo #if UNITY_EDITOR , Patch patch #endif ) { bool delayed = !Mathf.Approximately(ap.delay, 0f); if (delayed || (!randomize && !increment) || lastFrame != Time.frameCount || !Application.isPlaying) { if (!delayed) { lastFrame = Time.frameCount; } return(Synthesizer.Activate( this, eo, ap #if UNITY_EDITOR , patch #endif )); } return(false); }
internal static bool Activate( AudioProgram a, Parameters.EnvelopeParams ep, ActivationParams ap #if UNITY_EDITOR , Patch patch #endif ) { var p = a.parameters; p.envelope = ep; float gain; var clip = a.GetClip(out gain); #if UNITY_EDITOR if (!clip) { Debug.LogError("Activate: Null AudioClip from patch: " + patch, patch); } #endif ap.volume *= 1f + gain; bool looping = Activate( a.mixerGroup, clip, p, ap #if UNITY_EDITOR , patch #endif ); return(looping); }
public bool Activate(ActivationParams ap, Parameters.EnvelopeParams ep) { return(program.Activate(ap, ep #if UNITY_EDITOR , this #endif )); }
public static uint KeyOn( out bool looping, Patch patch, Parameters.EnvelopeParams ep, Transform t = null, Vector3 pos = new Vector3(), float delay = 0f, float volume = 1f, float modVolume = 1f) { if (patch == null) { Debug.LogErrorFormat("AxelF.Synthesizer KeyOn: missing patch reference"); looping = false; return(0); } uint handle = GetNextHandle(); looping = patch.Activate( new ActivationParams { transform = t, position = pos, delay = delay, volume = volume, modVolume = modVolume, handle = handle }, ep); return(handle); }