我从苹果开发者网站获得了一些关于纹理的代码,其中包括以下内容:
Character *character = [Character spriteNodeWithImageNamed: @"Obstacle03.png"];
SKTextureAtlas *atlas = [SKTextureAtlas atlasNamed:@"character"];
SKTexture *a1 = [atlas textureNamed:@"Obstacle.png"];
SKTexture *a2 = [atlas textureNamed:@"Obstacle02.png"];
SKTexture *a3 = [atlas textureNamed:@"Obstacle03.png"];
SKTexture *a4 = [atlas textureNamed:@"Obstacle04.png"];
NSArray *characterWalkTextures = @[a1,a2,a3,a4];
SKAction *characterAnimate = [SKAction animateWithTextures:characterWalkTextures timePerFrame:0.5];
[self runAction:characterAnimate];
但是,不是通过一组纹理循环的字符节点,节点只显示为一个内部带有红色x的框。我做错了什么?