2016-09-05 54 views
0

我想弄清楚如何轉換類的類型,以便我可以從我的SKScene這是'自我'我的SCNScene這是GamePlay。基本上執行場景正常場景轉換。如何轉換類的類型?

enter image description here 代碼:

let scene = GamePlay(coder:NSCoder()) 
let transition = SKTransition.crossFadeWithDuration(1) 
view?.presentScene(scene, transition: transition) 

回答

0

儘量施展你sceneSKScene

let scene = GamePlay(coder:NSCoder()) 
let transition = SKTransition.crossFadeWithDuration(1) 
if let skScene = scene as? SKScene { 
     view?.presentScene(skScene, transition: transition) 
}