API Reference
| API | 用途 | 返り値 | メモ |
|---|---|---|---|
app.spawn(type, options) |
オブジェクトを作成します。 | SceneObject |
Cube / Empty / PNG / VRM の起点です。 |
app.setCameraTarget(object, camera?) |
カメラの追尾先を設定します。 | void |
Scene View と Game View の切り替え確認にも使えます。 |
app.loadImageAnimation(frames, options) |
PNG フレーム列を読み込みます。 | Promise<ImageAnimation> |
SpriteSheet / frame list の両方を想定します。 |
app.loadVrm(source, options) |
VRM を読み込みます。 | Promise<VrmObject> |
待機ポーズ、モーション、表情の起点です。 |
app.spawn(type, options)
オブジェクトを作成します。Cube / Empty / PNG / VRM などを追加する起点です。
const obj = app.spawn("Cube", {
position: { x: 0, y: 0, z: 0 },
size: { x: 1, y: 1, z: 1 },
});
app.setCameraTarget(object, camera?)
カメラの追尾先を切り替えます。Scene View の補助操作にも使えます。
app.setCameraTarget(player); app.setCameraTarget(player, "SceneCamera");
app.loadImageAnimation(frames, options)
PNG のフレーム列を読み込んで、再生可能なアニメーションに変換します。
const clip = await app.loadImageAnimation(
["idle_01.png", "idle_02.png"],
{ loop: true, fps: 8 }
);
app.loadVrm(source, options)
VRM を読み込み、モーションやポーズの再生対象として使います。
const avatar = await app.loadVrm("assets/character.vrm", {
pose: "idle",
});