我已经在我的Cocos2d应用程序中为CCSprite实现了自己的自定义子类,但是当我遍历我的孩子时,我的isKindOfClass为我的CCLabelTTf返回true,而CCLabelTTf不是我的GameCharacter的子类。
CCArray *listOfGameObjects = [self children];
for (id tempObj in listOfGameObjects) {
if ([tempObj isKindOfClass:[GameCharacter class]]) {
GameCharacter *gameChar = (GameCharacter*)tempObj;
[gameChar updateStateWithDeltaTime:delta andListOfGameObjects:listOfGameObjects];
}
}