是否可以从SCNView转换为UIView?我在SCNView上有一个覆盖的登录按钮,但是我想要登录按钮将用户带到UIView进行登录。
答案 0 :(得分:0)
可能不是最优雅的方式,但这样的事情可能对你有用.....
- (void) handleTap:(UITapGestureRecognizer*)gestureRecognizer {
// get tap location
CGPoint p = [gestureRecognizer locationInView:scnView];
// convert to sk scene coordinates
CGPoint p2D = [scnView.overlaySKScene convertPointFromView:p];
//test if we hit the login button
SKNode *loginButton = [scnView.overlaySKScene nodeAtPoint:p2D];
// assuming your loginButton is of type SKLabelNode
if (loginButton != nil && ( [loginButton isMemberOfClass:[SKLabelNode class]] )) // add other tests here
{
// Here you can add code to transition to another
// view controller to handle logins
} else {
// do hit test on scnView here for the 3D scene
// .........
}
}