无法使用XCode 7 beta 3在操场上加载场景

时间:2015-07-19 19:06:26

标签: xcode scenekit xcode7

我无法在XCode 7 beta 3游乐场加载场景......虽然它正在使用Xcode 6.4 ....它是bug还是改变了什么?

ps:SCNScene(名称:" ship.dae")返回nil。

在我的Resources文件夹中是ship.dae和texture.png(来自SceneKit模板),这是我的代码:

//: Playground - noun: a place where people can play

import SceneKit
import XCPlayground

var view = SCNView(frame: NSRect(x: 0, y: 0, width: 500, height: 500))
var scene = SCNScene(named: "ship.dae")
view.scene = scene

XCPShowView("view", view: view)

1 个答案:

答案 0 :(得分:3)

在Xcode 7中

import XCPlayground    

let view = // your view
XCPlaygroundPage.currentPage.liveView = view

在Xcode 8中

import PlaygroundSupport  

let view = // your view
PlaygroundPage.current.liveView = view