예제 #1
0
 public bool Run(Cutscene cs, double delta)
 {
     time += delta;
     if (time > Duration)
     {
         if (Curve != null)
         {
             Process(Curve.GetValue(Duration, Duration));
         }
         else
         {
             Process(1);
         }
         return(false);
     }
     if (Curve != null)
     {
         Process(Curve.GetValue((float)time, Duration));
     }
     else
     {
         Process((float)time / Duration);
     }
     return(true);
 }
예제 #2
0
            public bool Run(Cutscene cs, double delta)
            {
                time += delta;
                if (time >= Duration)
                {
                    Target.Light.Color   = TargetDiffuse ?? Source.Color;
                    Target.Light.Ambient = TargetAmbient ?? Source.Ambient;
                    return(false);
                }
                var pct = (float)(time / Duration);

                if (ParamCurve != null)
                {
                    pct = ParamCurve.GetValue((float)time, (float)Duration);
                }
                if (TargetDiffuse != null)
                {
                    Target.Light.Color = AlchemyEasing.EaseColorRGB(EasingTypes.Linear, pct, 0, 1, Source.Color,
                                                                    TargetDiffuse.Value);
                }
                if (TargetAmbient != null)
                {
                    Target.Light.Ambient = AlchemyEasing.EaseColorRGB(EasingTypes.Linear, pct, 0, 1, Source.Color,
                                                                      TargetAmbient.Value);
                }
                return(true);
            }
예제 #3
0
            public bool Run(Cutscene cs, double delta)
            {
                time += delta;
                if (time >= Duration)
                {
                    Renderer.SParam = EndSParam;
                    return(false);
                }
                var pct = (float)(time / Duration);

                if (ParamCurve != null)
                {
                    pct = ParamCurve.GetValue((float)time, (float)Duration);
                }
                Renderer.SParam = MathHelper.Lerp(StartSParam, EndSParam, pct);
                return(true);
            }
예제 #4
0
 public float GetT(float intime)
 {
     if (Duration <= 0)
     {
         return(1);
     }
     if (intime > Duration)
     {
         intime = Duration;
     }
     if (intime < 0)
     {
         intime = 0;
     }
     if (ParamCurve != null)
     {
         return(ParamCurve.GetValue(intime, Duration));
     }
     else
     {
         return(intime / Duration);
     }
 }