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; })); }
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; } })); }