1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
| // Task 1: 초기화 (Initialization)
.task {
do {
await model.loadAssets() // [중요] 에셋 프리로딩 (아까 수정한 부분)
// 데이터 프로바이더 지원 여부 확인 후 세션 시작
if model.dataProvidersAreSupported && model.isReadyToRun {
try await model.session.run([model.sceneReconstruction, model.handTracking])
}
} catch { ... }
}
// Task 2: 손 추적 루프 (Hand Tracking Loop)
.task {
await model.processHandUpdates()
}
// Task 3: 메쉬 업데이트 루프 (Mesh Reconstruction Loop)
.task(priority: .low) { // [최적화] 낮은 우선순위
await model.processReconstructionUpdates()
}
|