Пример #1
0
 public static IEnumerator Fade(this Renderer self, float start, float end, float time)
 {
     foreach (var value in MathR.LerpE(start, end, time))
     {
         self.SetAlpha(value);
         yield return(null);
     }
 }
Пример #2
0
 public static IEnumerable Fade(this MediaPlayerCtrl self, float start, float end, float time, MathR.LerpType type)
 {
     foreach (var value in MathR.LerpE(start, end, time, type))
     {
         self.ForEachRenderer(r => r.SetAlpha(value));
         yield return(null);
     }
 }
Пример #3
0
 //Shifts from top to bottom and swaps them.
 IEnumerator _ShiftPanels(float time)
 {
     foreach (var pos in MathR.LerpE(0f, 1f, time, shiftType))
     {
         if (pos < position)
         {
             continue;                                 //starts from the current location
         }
         SetPosition(pos);
         yield return(null);
     }
     SwapPanels();
 }
Пример #4
0
        IEnumerator Lerp(bool blurIn)
        {
            float itrMin = (blurIn) ? 0 : maxIteration;
            float itrMax = (blurIn) ? maxIteration : 0;
            float sprMin = (blurIn) ? 0 : maxSpread;
            float sprMax = (blurIn) ? maxSpread : 0;
            var   itrEnm = MathR.LerpE(itrMin, itrMax, lerpTime, lerpType).GetEnumerator();
            var   sprEnm = MathR.LerpE(sprMin, sprMax, lerpTime, lerpType).GetEnumerator();

            while (itrEnm.MoveNext() | sprEnm.MoveNext())
            {
                iterations = (int)itrEnm.Current;
                blurSpread = sprEnm.Current;
                yield return(null);
            }
        }
Пример #5
0
 IEnumerable <float> IterateScales()
 {
     return(MathR.LerpE(minSize, maxSize, lerpTime, lerpType));
 }