-
Notifications
You must be signed in to change notification settings - Fork 1
Scene API
Daisuke Tsukada edited this page Dec 19, 2025
·
1 revision
シーン操作に関する API です。
| API | 説明 |
|---|---|
unity.scene.list |
シーン内のオブジェクト一覧を取得 |
unity.scene.getActive |
アクティブシーンの情報を取得 |
unity.scene.create |
新しいシーンを作成 |
unity.scene.open |
シーンを開く |
unity.scene.save |
シーンを保存 |
unity.scene.getHierarchy |
シーン階層を取得 |
unity.scene.find |
オブジェクトを検索 |
シーン内のすべてのルートオブジェクトを取得します。
| 名前 | 型 | 必須 | 説明 |
|---|---|---|---|
maxDepth |
integer | No | 取得する階層の深さ(デフォルト: 1) |
{
"sceneName": "SampleScene",
"objects": [
{
"name": "Main Camera",
"path": "/Main Camera",
"children": []
},
{
"name": "Directional Light",
"path": "/Directional Light",
"children": []
}
]
}名前やパスでオブジェクトを検索します。
| 名前 | 型 | 必須 | 説明 |
|---|---|---|---|
query |
string | Yes | 検索クエリ(名前または部分一致) |
searchType |
string | No | 検索タイプ: "name", "path", "tag" |
{
"results": [
{
"name": "Player",
"path": "/Player",
"instanceId": 12345
}
]
}シーンの完全な階層構造を取得します。
| 名前 | 型 | 必須 | 説明 |
|---|---|---|---|
maxDepth |
integer | No | 最大階層深度 |
{
"sceneName": "SampleScene",
"rootObjects": [
{
"name": "Canvas",
"path": "/Canvas",
"children": [
{
"name": "Button",
"path": "/Canvas/Button",
"children": []
}
]
}
]
}