Ios TextureAtlas工具未读取纹理图集-SpriteKit纹理图集生成器错误

Ios TextureAtlas工具未读取纹理图集-SpriteKit纹理图集生成器错误,ios,animation,atlas,Ios,Animation,Atlas,我试图用一个简单的动画制作一个节点,所以我创建了一个动画,每个帧都是一个.png文件,我把它们都放在一个文件夹中,并命名为stoneanimation2.atlas 这是我尝试的代码: SKTextureAtlas *atlas = [SKTextureAtlas atlasNamed:@"stoneanimation2"]; SKTexture *stone2 = [atlas textureNamed:@"stone2.png"]; SKTexture *stone3 =

我试图用一个简单的动画制作一个节点,所以我创建了一个动画,每个帧都是一个.png文件,我把它们都放在一个文件夹中,并命名为stoneanimation2.atlas

这是我尝试的代码:

SKTextureAtlas *atlas = [SKTextureAtlas atlasNamed:@"stoneanimation2"];


    SKTexture *stone2 = [atlas textureNamed:@"stone2.png"];
    SKTexture *stone3 = [atlas textureNamed:@"stone3.png"];
    SKTexture *stone4 = [atlas textureNamed:@"stone4.png"];
    SKTexture *stone5 = [atlas textureNamed:@"stone5.png"];
    SKTexture *stone6 = [atlas textureNamed:@"stone6.png"];
    SKTexture *stone7 = [atlas textureNamed:@"stone7.png"];
    SKTexture *stone8 = [atlas textureNamed:@"stone8.png"];
    SKTexture *stone9 = [atlas textureNamed:@"stone9.png"];
    SKTexture *stone10 = [atlas textureNamed:@"stone10.png"];
    SKTexture *stone11 = [atlas textureNamed:@"stone11.png"];
    SKTexture *stone12 = [atlas textureNamed:@"stone12.png"];
    SKTexture *stone13 = [atlas textureNamed:@"stone13.png"];
    SKTexture *stone14 = [atlas textureNamed:@"stone14.png"];
    SKTexture *stone15 = [atlas textureNamed:@"stone15.png"];
    SKTexture *stone16 = [atlas textureNamed:@"stone16.png"];
    SKTexture *stone17 = [atlas textureNamed:@"stone17.png"];
    SKTexture *stone18 = [atlas textureNamed:@"stone18.png"];
    SKTexture *stone20 = [atlas textureNamed:@"stone20.png"];
    SKTexture *stone21 = [atlas textureNamed:@"stone21.png"];
    SKTexture *stone22 = [atlas textureNamed:@"stone22.png"];
    SKTexture *stone23 = [atlas textureNamed:@"stone23.png"];
    SKTexture *stone24 = [atlas textureNamed:@"stone24.png"];
    SKTexture *stone25 = [atlas textureNamed:@"stone25.png"];
    SKTexture *stone26 = [atlas textureNamed:@"stone26.png"];
    SKTexture *stone27 = [atlas textureNamed:@"stone27.png"];
    SKTexture *stone28 = [atlas textureNamed:@"stone28.png"];

    NSArray *atlasTexture = @[stone2,stone3,stone4,stone5,stone6,stone7,stone8,stone9,stone10,stone11,stone12,stone13,stone14,stone15,stone16,stone17,stone18,stone20,stone21,stone22,stone23,stone24,stone25,stone26,stone27,stone28];

    stoneAnimation = [SKAction animateWithTextures:atlasTexture timePerFrame:.01];
以前我只有10帧左右的画面时,它就起作用了。但是我决定添加更多,我认为它把atlas本身搞砸了,因为Xcode说“SpriteKit纹理atlas生成器错误”,这是错误消息:

Command /Applications/Xcode.app/Contents/Developer/Tools/../usr/bin/TextureAtlas failed with exit code 11

每次我完全制作一个新的地图集,或者只是重新命名它,看看它是否有效,我都会得到同样的错误。另外,在构建设置中,我将“启用Atlas生成器”设置为“是”。我已经尝试过重置IOS模拟器,以及我能想到的一切!请帮忙

添加属性NSArray*\u stoneFrames

-(void)addObject
 {
  NSMutableArray *stoneAnimationFrames = [NSMutableArray array];
  SKTextureAtlas *stoneAnimatedAtlas = [SKTextureAtlas atlasNamed:@"stoneanimation2"];
  int numImages = stoneAnimatedAtlas.textureNames.count;
  for (int i=1; i <= numImages; i++) {
    NSString *textureName = [NSString stringWithFormat:@"stone%d", i];
    SKTexture *temp = [stoneAnimatedAtlas textureNamed:textureName];
    [stoneAnimationFrames addObject:temp];
  }
 _stoneFrames = stoneAnimationFrames;
 SKTexture *temp = _stoneFrames[0];
 _stone = [SKSpriteNode spriteNodeWithTexture:temp];
 [self addChild:_stone];
 [self animateStone];
}

-(void)animateStone
 {
      [_stone runAction:[SKAction repeatActionForever:
                  [SKAction animateWithTextures:_stoneFrames
                                   timePerFrame:0.1f
                                         resize:NO
                                        restore:YES]] withKey:@"animated Stone"];
    return;
}
-(void)addObject
{
NSMutableArray*stoneAnimationFrames=[NSMutableArray];
SKTextureAtlas*stoneAnimatedAtlas=[SKTextureAtlas atlasNamed:@“stoneanimation2]”;
int numImages=stoneanimatedatals.textureNames.count;

对于(int i=1;i当我的纹理图集中有太多大的图像时,这个错误发生在我身上。在将其拆分为两个单独的图集后,游戏构建得很好。

我发现我的问题是纹理图集没有正确导入,我想这是因为我之前正确导入了纹理图集,然后对其进行了更改。因此我在项目导航器中的纹理图集。我不需要更改任何代码,只需右键单击纹理图集,然后单击:源代码管理>添加选定文件


这与我的代码无关

如果其他人出现此错误,我会找出原因:我所要做的就是右键单击纹理图集并单击“添加”。这与我的代码无关。我也有相同的错误。请告诉我如何解决此问题。我的问题是纹理图集没有正确导入,我想是的是因为我之前正确导入了它,然后对其进行了更改。因此,我在项目导航器中的纹理图集中获得了一个?字符。我不需要更改任何代码,只需右键单击纹理图集,然后单击:源代码管理>添加所选文件。