【发布时间】:2014-10-17 05:04:39
【问题描述】:
我想替换项目中的场景。 我在 xcode 版本 6 中使用 spritekit 和 swift 制作了项目
现在,当我尝试使用它编写替换场景代码时
for touch:AnyObject in touches
{
let location=touch.locationInNode(self)
if self.nodeAtPoint(location)==self.playbutton
{
println("Go to the game!")
var scene=PlayScene(size:self.size)
let skView = self.view as SKView //ERROR
}
}
它给了我错误:
来自“SKView”的失望?到 'SKView' 只打开选项;你的意思是使用'!'?
【问题讨论】:
-
let skView = self.view? as SKView!
标签: swift sprite-kit xcode6