我有以下可以正确加载的 Reality Composer 项目。如您所见,当动画完成时,它应该使用关键字“attackComplete”进行通知。
我如何获得此通知?
import RealityKit
import ARKit
class ViewController: UIViewController, ARSessionDelegate {
@IBOutlet var arView: ARView!
override func viewDidLoad() {
super.viewDidLoad()
let boxAnchor = try! Experience.loadOrcAttack()
arView.session.delegate = self
arView.scene.anchors.append(boxAnchor)
print("done")
}
func session(_ session: ARSession, didUpdate anchors: [ARAnchor]) {
print(anchors)
}
}