예제 #1
0
 public override void ToParam(object[] o)
 {
     if (o[0] != null)
     {
         FadeoutDuration = Convert.ToSingle(o[0]);
     }
     if (o[1] != null)
     {
         StartFadeFactor = Convert.ToSingle(o[1]);
     }
     if (o[2] != null)
     {
         FadeOutType = (FadeOutEaseType)Convert.ToInt32(o[2]);
     }
 }
예제 #2
0
        private float CalculateFadeOutFactor(float currentValue, float iMin, float iMax, float oMin, float oMax, FadeOutEaseType easeType)
        {
            float finalValue = oMin + (currentValue - iMin) * (oMax - oMin) / (iMax - iMin);

            switch (easeType)
            {
            case FadeOutEaseType.easeInCubic:
                finalValue = easeInCubic(oMin, oMax, finalValue);
                break;

            case FadeOutEaseType.easeOutCubic:
                finalValue = easeOutCubic(oMin, oMax, finalValue);
                break;

            case FadeOutEaseType.easeOutExpo:
                finalValue = easeOutExpo(oMin, oMax, finalValue);
                break;

            case FadeOutEaseType.easeInExpo:
                finalValue = easeInExpo(oMin, oMax, finalValue);
                break;

            default:
                break;
            }
            return(finalValue);
        }