如何添加/刪除CCMenu點擊相同的按鈕是什麼時候?我添加了一些代碼..提前的Cocos2D如何刪除/發行/清理CCMenu
謝謝..
CCMenu *menu;
if (!isMenuVisible) {
CCMenuItemSprite *item = [CCMenuItemSprite itemFromNormalSprite: .......];
menu = [CCMenu menuWithItems:item, nil];
[self addChild:menu];
} else {
// [menu cleanup];/// didn't work
// [menu removeFromParentAndCleanup:YES]; //// didnt work
// [menu removeAllChildrenWithCleanup:YES]; //// didn't work
}
isMenuVisible = !isMenuVisible;
}