Nez.SceneTransition.tickEffectProgressProperty C# (CSharp) Method

tickEffectProgressProperty() public method

the most common type of transition seems to be one that ticks progress from 0 - 1. This method takes care of that for you if your transition needs to have a _progress property ticked after the scene loads.
public tickEffectProgressProperty ( Effect effect, float duration, EaseType easeType = EaseType.ExpoOut, bool reverseDirection = false ) : IEnumerator
effect Microsoft.Xna.Framework.Graphics.Effect
duration float duration
easeType EaseType
reverseDirection bool if true, _progress will go from 1 to 0. If false, it goes form 0 to 1
return IEnumerator
		public IEnumerator tickEffectProgressProperty( Effect effect, float duration, EaseType easeType = EaseType.ExpoOut, bool reverseDirection = false )
		{
			var start = reverseDirection ? 1f : 0f;
			var end = reverseDirection ? 0f : 1f;
			var progressParam = effect.Parameters["_progress"];

			var elapsed = 0f;
			while( elapsed < duration )
			{
				elapsed += Time.deltaTime;
				var step = Lerps.ease( easeType, start, end, elapsed, duration );
				progressParam.SetValue( step );

				yield return null;
			}
		}