public void menuCallback(CCObject pSender) { // get the userdata, it's the index of the menu item clicked CCMenuItem pMenuItem = (CCMenuItem)(pSender); int nIdx = pMenuItem.zOrder - 10000; // create the test scene and run it TestScene pScene = CreateTestScene(nIdx); if (pScene != null) { pScene.runThisTest(); } }
void MenuCallback(object sender) { // get the userdata, it's the index of the menu item clicked CCMenuItem menuItem = (CCMenuItem)sender; var nIdx = menuItem.ZOrder - MENU_ITEM_Z_ORDER; // create the test scene and run it TestScene scene = CreateTestScene(nIdx); if (scene != null) { scene.runThisTest(); } }
public void menuCallback(CCMenuItem pSender) { // get the userdata, it's the index of the menu item clicked CCMenuItem pMenuItem = (CCMenuItem)(pSender); int nIdx = (int)pMenuItem.UserData; // create the test scene and run it TestScene pScene = CreateTestScene(nIdx); if (pScene != null) { CCApplication.SharedApplication.GamePadDPadUpdate -= _GamePadDPadDelegate; CCApplication.SharedApplication.GamePadButtonUpdate -= _GamePadButtonDelegate; pScene.runThisTest(); } }