Exemple #1
0
    // Rotate cube

    // Sequence.Create() creates a new sequence and allows to add steps to it but, as opposed to Sequence.Start(), it only returns
    // it without subscribing to it.  It is the responsability of the caller to subscribe to it, or to pass it up the call chain.
    // NOTE: It is a very important best practice to preserve the chaining of your observables as much as possible and to avoid
    // breaking that chain with calls to Subscribe().  As much as possible/reasonable, try to defer the call to Subscribe() to
    // callers up the chain.  That ensures errors can always bubble up to higher level functions and also that disposing the chain
    // at a higher level will dispose it completely.
    private IObservable <Unit> RotateCubeIndefinitely() =>
    Sequence
    .Create(
        () => RotateCube(Vector3.up * 180),
        () => RotateCube(Vector3.right * 180),
        () => RotateCube(Vector3.forward * 180))
    .Repeat();
Exemple #2
0
 public static object AddSequence(this ISequencer This, IEnumerable <ICompletable> observables) =>
 This.Add(() => Sequence.Create(observables));
Exemple #3
0
 public static object AddSequence(this ISequencer This, params Func <ICompletable>[] selectors) =>
 This.Add(() => Sequence.Create(selectors));
Exemple #4
0
 public static object AddSequence(this ISequencer This, Action <ISequencer> action) =>
 This.Add(() => Sequence.Create(action));
 public static Sequence ToSequence(this IEnumerable <ICompletable> This) =>
 Sequence.Create(This);