private void BuildWaveProcesses() { if (waves.Length == 0) { return; } WaveProcess first = new WaveProcess(waves[0]); WaveProcess current = first; for (int i = 1; i < waves.Length; i++) { TimedProcess delay = new TimedProcess(waves[i - 1].postDelay); current.Attach(delay); current = new WaveProcess(waves[i]); delay.Attach(current); } procManager.LaunchProcess(first); }
public void FadeFromBlack(float duration, Process.OnTerminateCallback endCallback, float delay = 0f) { FadeInProcess fadeIn = new FadeInProcess(duration, fadeGraphic, true); if (endCallback != null) { fadeIn.TerminateCallback += endCallback; } if (delay != 0f) { TimedProcess delayProcess = new TimedProcess(delay); delayProcess.Attach(fadeIn); pm.LaunchProcess(delayProcess); } else { pm.LaunchProcess(fadeIn); } }
public void FadeToBlack(float duration, Process.OnTerminateCallback endCallback, float delay = 0f, float endAlpha = 1f, bool useCurrentAlpha = false) { FadeOutProcess fadeOut = (useCurrentAlpha) ? new FadeOutProcess(duration, fadeGraphic, endAlpha, true) : new FadeOutProcess(duration, fadeGraphic, endAlpha); if (endCallback != null) { fadeOut.TerminateCallback += endCallback; } if (delay != 0f) { TimedProcess delayProcess = new TimedProcess(delay); delayProcess.Attach(fadeOut); pm.LaunchProcess(delayProcess); } else { pm.LaunchProcess(fadeOut); } }