Button Effekt in VR
import SwiftUI
import RealityKit
import RealityKitContent
struct ContentView: View {
var body: some View {
ZStack {
RealityView { content in
let box = ModelEntity(mesh: .generateBox(size: 0.1))
box.position = [0, 0, -0.5]
content.add(box)
}
VStack {
Spacer()
HStack {
Spacer()
Button(action: {
print("AR Button Pressed")
}) {
Label("Interact", systemImage: "hand.tap")
.padding()
.background(.ultraThinMaterial)
.clipShape(Capsule())
}
.padding()
}
}
}
.edgesIgnoringSafeArea(.all)
}
}