请帮助我抽象接触开始的方法。我在现场有这个方法,VZChurch 它是 SKSpriteNode。有没有办法在 SKSpriteNode 的子类中转移 touches started 方法,因为我认为 5-6 if else 语句不亮决定,所以我尝试在 SKSpriteNode 的每个子类中找到迁移 touches started 方法的方法
- (void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
UITouch *touch = [touches anyObject];
CGPoint location = [touch locationInNode:self.mapStaticGeometry];
SKNode *node = [self.mapStaticGeometry nodeAtPoint:location];
if ([node.name isEqualToString:@"church"]) {
VZChurch *obj = (VZChurch *)node;
obj.requestedAnimation = VZAnimationStateTouch;
[obj runAnimation];
} else if ...n iterations
}