Ejemplo n.º 1
0
 private static CPath Apply(CPath path, CPathEasingAction action, DEasing method, float from, float to, float time)
 {
     return(path.Add(p =>
     {
         if (p.DeltaF < time)
         {
             action.Invoke(method.Invoke(p.DeltaF, from, to, time));
             return Status.Continue;
         }
         action.Invoke(to);
         return Status.OK;
     }));
 }
Ejemplo n.º 2
0
        public static CPath TimeAction(this CPath path, float time, DPathAction action)
        {
            return(path.Add(p =>
            {
                if (p.DeltaF < time)
                {
                    return Status.Continue;
                }
                var status = action.Invoke();
                switch (status)
                {
                case Status.Continue:
                    p.ResetTimerVariables();
                    return Status.Continue;

                default:
                    return status;
                }
            }));
        }
Ejemplo n.º 3
0
 public static CPath EasingBounceEaseOutIn(this CPath path, float time, float from, float to, CPathEasingAction action)
 {
     return(Apply(path, action, EasingTo.BounceEaseOutIn, from, to, time));
 }
Ejemplo n.º 4
0
 public static CPath EasingElasticEaseOut(this CPath path, float time, float from, float to, CPathEasingAction action)
 {
     return(Apply(path, action, EasingTo.ElasticEaseOut, from, to, time));
 }
Ejemplo n.º 5
0
 public static CPath EasingQuadEaseIn(this CPath path, float time, float from, float to, CPathEasingAction action)
 {
     return(Apply(path, action, EasingTo.QuadEaseIn, from, to, time));
 }
Ejemplo n.º 6
0
 public static CPath EasingLinear(this CPath path, float time, float from, float to, CPathEasingAction action)
 {
     return(Apply(path, action, EasingTo.Linear, from, to, time));
 }
Ejemplo n.º 7
0
 public Status Invoke(CPath p)
 {
     return(Action1 != null?Action1.Invoke(p) : Action2.Invoke());
 }