我想暂停场景,我可以用这段代码暂停它,但当我点击相同的按钮时,如何恢复它?如何恢复暂停按钮 - 雪碧套件
@property (SK_NONATOMIC_IOSONLY, getter = isPaused) BOOL paused;
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
for (UITouch *touch in touches)
{
SKSpriteNode *pause = (SKSpriteNode*)[self childNodeWithName:@"pause"];
CGPoint location = [touch locationInNode:self];
if([pause containsPoint:location])
{
self.scene.view.paused = YES;
}
}
}
你试过可变基于其当前状态更改暂停财产? –
这会切换它:self.scene.view.paused =!self.scene.view.paused; – LearnCocos2D