Created
June 22, 2024 12:54
-
-
Save flushpot1125/5a3726441fe7655e580ac69f52ceb9e0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
} attachments: { | |
Attachment(id: "ui_panel") { | |
HStack { | |
// A button to reload the current scene. | |
Button { godotVision.reloadScene() } label: { | |
Text("Reload") | |
} | |
// Buttons for loading example scenes. | |
sceneButton(label: "Hello", resourcePath: "res://examples/hello/example_godot_vision_scene.tscn") | |
sceneButton(label: "Physics", resourcePath: "res://examples/physics_toy/physics_toy.tscn") | |
//sceneButton(label: "Materials", resourcePath: "res://tests/materials/materials.tscn") | |
sceneButton(label: "Skeletons", resourcePath: "res://examples/rigged_models/example_rigged_models.tscn") | |
sceneButton(label: "CSG", resourcePath: "res://examples/csg/csg.tscn") | |
}.padding(36).frame(width: 700).glassBackgroundEffect() | |
} | |
} | |
} | |
.modifier(GodotVisionRealityViewModifier(coordinator: godotVision)) | |
} | |
@ViewBuilder | |
func sceneButton(label: String, resourcePath: String) -> some View { | |
Button { | |
godotVision.changeSceneToFile(atResourcePath: resourcePath) | |
} label: { | |
Text(label) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment