コード例 #1
0
        // --------------------------------------------------------------------------

        Behavior <float> ToSingle()
        {
            return(Behavior.Create(ctx => Convert.ToSingle(this.BehaviorFunc(ctx))));
        }
コード例 #2
0
 public static Behavior <T> Wait <T>(this Behavior <T> v, float delay)
 {
     return(Behavior.Create(ctx => v.BehaviorFunc(new BehaviorContext(ctx.Time + delay))));
 }
コード例 #3
0
 // Extension method for floats only
 public static Behavior <float> Forever(this float v)
 {
     return(Behavior.Create(ctx => v));
 }
コード例 #4
0
 public static Behavior <T> Faster <T>(this Behavior <T> v, float speed)
 {
     return(Behavior.Create(ctx => v.BehaviorFunc(new BehaviorContext(ctx.Time * speed))));
 }
コード例 #5
0
 // Create constant behavior from a value
 public static Behavior <T> Forever <T>(T v)
 {
     return(Behavior.Create(ctx => v));
 }