我可以在 Xcode 的场景编辑器中设置 SCNScene 的背景吗?
Can I set the background of a SCNScene from the scene editor in Xcode?
这可能是一个愚蠢的问题,但我如何从场景编辑器本身设置我的场景背景?我希望场景是透明的,这样我就可以将它覆盖在 UI 之上,现在我在代码中做到了:
func initMainScene() -> SCNScene {
guard let newScene = SCNScene(named : "mainScene.scn")
else { fatalError("Unable to load scene file.") }
newScene.background.contents = UIColor.clear
return newScene
}
场景背景颜色可以在右边最后一个检查器中编辑(名为“场景检查器”,快捷键⌘⌥8)
这可能是一个愚蠢的问题,但我如何从场景编辑器本身设置我的场景背景?我希望场景是透明的,这样我就可以将它覆盖在 UI 之上,现在我在代码中做到了:
func initMainScene() -> SCNScene {
guard let newScene = SCNScene(named : "mainScene.scn")
else { fatalError("Unable to load scene file.") }
newScene.background.contents = UIColor.clear
return newScene
}
场景背景颜色可以在右边最后一个检查器中编辑(名为“场景检查器”,快捷键⌘⌥8)