如何实现sprite kit的触摸和保持?

use*_*383 3 iphone ipad ios sprite-kit

我最近开始合作sprite-kit.我知道只touchesBegan适用于一个水龙头,但有什么我可以使用,将识别触摸被按下?

And*_*eev 5

如果你想实现像拍摄这样的东西,你需要开始拍摄touchesBegan方法并停止拍摄touchesEnded方法:

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
    [self startShooting];
}

- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
    [self stopShooting];
}
Run Code Online (Sandbox Code Playgroud)

出于其他目的,您可以添加UILongPressGestureRecognizerSKScene