MotionWorld
独立したTweenの集合と更新時計を持ちます。WithSchedulerでビルダーを登録し、メインスレッドでTickに経過秒数を渡します。
public sealed class MotionWorld : IDisposable, IMotionSchedulerMotionWorld.cs · L122つの時計を独立して進める
using MeatMotion; を追加します。片方のworldだけにTickを呼ぶと、もう片方の値は初期値のままです。
float a = 0f, b = 0f;
using var first = new MotionWorld();
using var second = new MotionWorld();
MMotion.Create(0f, 1f, 1f).WithScheduler(first).Bind(v => a = v);
MMotion.Create(0f, 1f, 1f).WithScheduler(second).Bind(v => b = v);
first.Tick(0.5);
メンバー
Default
既定の自動更新worldを取得します。
public static MotionWorld Default { get; }MotionWorld
独立した手動worldを作成します。使用後はDisposeで解放します。
Schedule
呼び出し元のworldの時計でビルダーを登録し、MotionHandleを返します。
public MotionHandle Schedule<TValue, TOptions, TAdapter>(ref MotionBuilder<TValue, TOptions, TAdapter> builder)
where TValue : unmanaged
where TOptions : unmanaged, IMotionOptions
where TAdapter : unmanaged, IMotionAdapter<TValue, TOptions>引数と戻り値
builderref MotionBuilder<TValue, TOptions, TAdapter>設定済みのビルダー。拡張メソッドでは呼び出し元として渡されます。- 戻り値
MotionHandle
EnsureCapacity
指定件数を扱えるようにストレージを事前確保します。
Tick
手動worldに渡した経過秒数だけ、登録したTweenを更新します。
Dispose
worldのストレージと管理するTweenを解放します。
public void Dispose()CancelAll
このworldのTweenをまとめてキャンセルします。
public void CancelAll()
MeatMotion