I don't have a fancy solution with code for you, but two possibilities are possible:
. , . SceneKit SpriteKit, , ( , SpriteKit). , action Scenekit. , 3D- .
. bool Scenekit, isHandledInOverlay SpriteKit, . Scenekit bool handletap return , .
:
:
if self.actionButtonNode.contains(location!) {
print("actionButtonNode touch")
}
handleTap ViewController. var, SKOverlayScene, , , actionButtonNode ( ) , handleTap - :
if self.theOverlay.actionButtonNode.contains(taplocation) {
print("actionButtonNode touch")
} else if self.theOverlay.action2ButtonNode.contains(taplocation) {
print("action2ButtonNode touch")
} else if self.theOverlay.action3ButtonNode.contains(taplocation) {
print("action3ButtonNode touch")
} else {
//no buttons hit in 2D overlay, let do 3D hittest:
let opts = [ SCNHitTestOption.searchMode:1, SCNHitTestOption.ignoreHiddenNodes:0 ]
let hitList = self.sceneView!.hitTest(taplocation, options: opts)
if hitList.count > 0 {
for hit in hitList {
print("hit:", hit)
}
}
}
, 2D- (-), , , , , , 3D- , .
Edit: (obj c) , Y , SKOverlay:
CGPoint tappedSKLoc = CGPointMake(location.x, self.menuOverlayView.view.frame.size.height-location.y);
, , , .