Lua即時実行
dx12_eval_luaEvaluate Lua code in the engine's Lua environment to debug and modify scene entities, physics forces, and audio during editing or playback. Returns the string representation of the code's return value.
Instructions
任意の Lua コードをエンジンの Lua state でその場実行する(強力なデバッグ機能)。globals フォールバック環境なので scene/physics/camera/audio/events 等の既存グローバルバインディング(dx12_describe_lua_api 参照)がそのまま使える。例: local e = scene:findEntity("Player"); e.transform.position.y = e.transform.position.y + 1; return e.transform.position.y。code が値を return していれば result にその tostring() 文字列が入る(無ければ空文字)。★print() は捕捉されない — デバッグ出力は log(msg) を使うと dx12_get_log に出る。副作用のある操作(位置変更・物理力印加等)は Editor/Playing 両方で実行できるが、bodies は Play 中のみ登録されているため物理系は Playing 中でないと効果が無い。localhost 限定・認証なしという既存のセキュリティモデルと同水準。
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | 実行する Lua コード(複数行可)。 |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | No | エンジンからの生の結果。実際の形は各ツールの説明 / dx12_describe_components を参照。text にも同内容を JSON 文字列で格納。 |