Inspector: component view part (#55)

This PR allow to send entity components data to typescript with
inspector-dom event

Event data

![image](https://github.com/storytold/storyteller-bevy/assets/10954133/f4b5a88e-0a8d-4d56-ade2-d0102a6c08f7)

Component register example

![image](https://github.com/storytold/storyteller-bevy/assets/10954133/f9480f0a-a657-4445-a0d4-0984e2f69900)

Read event example

![image](https://github.com/storytold/storyteller-bevy/assets/10954133/2b6480f0-d1fb-42f1-bd6e-dfbc3d4676a2)


This PR is the first step of new inspector backend logic
Next parts is:
- Allow to edit components fields 
- Allow to show asset data (like show Handle<StandartMaterial> data)
- Allow to edit asset fields
This commit is contained in:
rewin
2024-02-29 23:17:51 +03:00
committed by GitHub
parent f31cf35da1
commit ae88696213
6 changed files with 233 additions and 2 deletions
+7
View File
@@ -40,6 +40,13 @@ export class AppElement extends LitElement {
return this;
}
@on("inspector-changed")
onInspectorChanged(event: studio.InspectorChanged): void {
const data = event.detail ? JSON.parse(event.detail) : null;
console.log("Inspector changed:", data);
}
@on("scene-saved")
async onSceneSaved({ detail: scene }: SceneSavedEvent): Promise<void> {
const file = new File([scene], "scene.scn.ron", { type: "text/ron" });
+1 -1
View File
@@ -1 +1 @@
import "./app/app.element";
import "./app/app.element";