0
我試圖運行SceneKit動畫片 「DAE」 的模式:SceneKit Swift3編譯器錯誤
let url = Bundle.main.url(forResource: "art.scnassets/Player(walking)", withExtension: "dae")
let sceneSource = SCNSceneSource(url: url!, options: [SCNSceneSource.LoadingOption.animationImportPolicy: SCNSceneSource.AnimationImportPolicy.playRepeatedly])
let animationIds: NSArray = sceneSource?.identifiersOfEntries(withClass: CAAnimation)
for eachId in animationIds {
let animation: CAAnimation = (sceneSource?.entryWithIdentifier(eachId as! String, withClass: CAAnimation.self))!
animations.add(animation)
}
character?._walkAnimations = animations
但是編譯器它拋出就行了:
讓animationIds:NSArray的= sceneSource? identifiersOfEntries(withClass:CAAnimation)
並寫入錯誤:
不能轉換v類型'[String]?'的含義到指定類型'NSArray'
請幫我解決這個問題。
在此先感謝。
感謝您的幫助。 –