运行场景(场景套件)?

时间:2015-03-17 07:07:17

标签: ios scenekit apple-watch

是否可以在Apple Watch上运行此代码:

 SCNScene *scene = [SCNScene sceneNamed:@"art.scnassets/ship.dae"];        
    // retrieve the ship node
    SCNNode *ship = [scene.rootNode childNodeWithName:@"ship" recursively:YES];

    // animate the 3d object
    [ship runAction:[SCNAction repeatActionForever:[SCNAction rotateByX:0 y:2 z:0 duration:1]]];

    // retrieve the SCNView
    SCNView *scnView = (SCNView *)self.view;

    // set the scene to the view
    scnView.scene = scene;

    // allows the user to manipulate the camera
    scnView.allowsCameraControl = YES;

    // show statistics such as fps and timing information
    scnView.showsStatistics = YES;

我无法将场景放在主控制器上。

SCNView *scnView = (SCNView *)self.view;

请帮助。

1 个答案:

答案 0 :(得分:4)

为Apple Watch制作应用程序的唯一方法是WatchKit。 WatchKit不包括在手表上显示任何iOS视图的功能,只包括WatchKit框架中定义的特定UI控件集。有关详细信息,请参阅WatchKit Programming Guide