簡體   English   中英

iOS 9 Spritekit雙擊不適用於iPhone 6S

[英]iOS 9 Spritekit Double Tap Not Working on iPhone 6S

我一直在建立一個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");
    }
}

對於SpriteKit游戲,現在需要實現iOS9或者6s(3d touch?)的新功能嗎?

我想指出,這在iPhone 6s模擬器中工作正常,但它不在實際設備上。

此外, touch.tapCount將報告touch.tapCount等點擊,但完全跳過第二次點擊。

好的,所以,雙擊是工作的,有點。 在iPhone 6s上,游戲雖然通過skView.showsFPS = YES;報告60 fps skView.showsFPS = YES; ,運行非常遲鈍。 我剛剛發現,如果我慢慢點擊,我可以讓水龍頭工作,就像在第一次和第二次點擊之間等待一秒鍾一樣。

現在發現為什么這個游戲在這個設備上這么慢。 它甚至不是iOS 9的問題,因為游戲在我的5s / iOS 9上運行得很好。

根據https://developer.apple.com/library/prerelease/ios/releasenotes/General/RN-iOSSDK-9.1/

UIKit
Note
On 3D Touch capable devices, touch pressure changes cause 
touchesMoved:withEvent: to be called for all apps running on iOS 9.0. 
When running iOS 9.1, the method is called only for apps 
linked with the iOS 9.0 (or later) SDK.

Apps should be prepared to receive touch move events 
with no change in the x/y coordinates.

所以如果這個問題可以由touchMoved引起。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM