我已经在制作一个SpriteKit游戏一段时间了。它是一款纸牌游戏,允许双击卡片图像进行特定行为。现在我们已经到了iOS 9版本,在iPhone 6s上双击根本不起作用。在iOS8上和所有设备上都可以正常运行。
在我的SKScene
中,我使用touchesBegan
方法检测点击:
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
UITouch *touch = [touches anyObject];
CGPoint touchLocation = [touch locationInNode:self];
if(touch.tapCount==2) {
NSLog(@"double-tap, but not for iPhone 6s");
}
}
iOS9或6s有什么新功能(3D Touch)需要现在为SpriteKit游戏进行实现吗?
我想指出,在iPhone 6s模拟器上这很好用,但在实际设备上不行。
此外,touch.tapCount
将报告3、4、5、6、7等点击数,但完全跳过第二次点击。