MeatMotion

MotionWorld

独立したTweenの集合と更新時計を持ちます。WithSchedulerでビルダーを登録し、メインスレッドでTickに経過秒数を渡します。

Namespace
MeatMotion
Assembly
MeatMotion

メンバー一覧へ

public sealed class MotionWorld : IDisposable, IMotionScheduler
MotionWorld.cs · L12

2つの時計を独立して進める

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で解放します。

public MotionWorld(int capacity = 0)
引数
capacity = 0
int 事前に確保する要素数。

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>
引数と戻り値
builder
ref MotionBuilder<TValue, TOptions, TAdapter> 設定済みのビルダー。拡張メソッドでは呼び出し元として渡されます。
戻り値
MotionHandle

EnsureCapacity

指定件数を扱えるようにストレージを事前確保します。

public void EnsureCapacity(int capacity)
引数
capacity
int 事前に確保する要素数。

Tick

手動worldに渡した経過秒数だけ、登録したTweenを更新します。

public void Tick(double deltaTime)
引数
deltaTime
double 前回の更新から進める秒数。

Dispose

worldのストレージと管理するTweenを解放します。

public void Dispose()

CancelAll

このworldのTweenをまとめてキャンセルします。

public void CancelAll()

関連する型