Add tank catalog with USDZ models and tank selection
Introduce TankDefinition/TankCatalog loaded from Tanks.json, bundle the Drachengas USDZ tank models, add tank selection and preview views, and update the AR experience, editor and project views to use the catalog. Includes tests for catalog loading and model selection. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@ -12,6 +12,8 @@ struct ProjectCreateView: View {
|
||||
@Environment(\.modelContext) private var modelContext
|
||||
@Environment(\.dismiss) private var dismiss
|
||||
|
||||
let onCreated: (Project) -> Void
|
||||
|
||||
@State private var leadID: String = ""
|
||||
@State private var customerName: String = ""
|
||||
@State private var creationDate: Date = .now
|
||||
@ -41,9 +43,7 @@ struct ProjectCreateView: View {
|
||||
)
|
||||
}
|
||||
|
||||
Section("Tankauswahl") {
|
||||
TankEditor(tank: $tank)
|
||||
}
|
||||
TankSelectionSection(tank: $tank)
|
||||
}
|
||||
.navigationTitle("Projekt erstellen")
|
||||
.navigationBarTitleDisplayMode(.inline)
|
||||
@ -72,11 +72,12 @@ struct ProjectCreateView: View {
|
||||
tank: tank
|
||||
)
|
||||
modelContext.insert(project)
|
||||
onCreated(project)
|
||||
dismiss()
|
||||
}
|
||||
}
|
||||
|
||||
#Preview {
|
||||
ProjectCreateView()
|
||||
ProjectCreateView { _ in }
|
||||
.modelContainer(for: Project.self, inMemory: true)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user