纹理地图集无法找到

And*_*o13 5 objective-c ios sprite-kit texture-atlas

我有一个名为plane1.atlas的纹理图集,其中包含许多图像.当我初始化Atlas并尝试使用其中一个纹理时,我收到错误消息"无法找到纹理图集".正如你在下面的照片中看到的那样,我有了初始化纹理的代码,我在包中有纹理图集,错误日志显示错误.

地图集问题

我在目标设置中有正确的设置,我尝试重命名纹理图集并在初始化/使用任何纹理时使用文件扩展名(我添加了.atlas和.png,不起作用).我也尝试了其他图像,但无济于事.尽管我多次重置内容/设置,但在设备和模拟器上都不起作用.

如果代码在图像中太小,则代码如下:

SKSpriteNode *planeCore;
SKSpriteNode *planeOutline;
SKSpriteNode *planeEngine1;
SKSpriteNode *planeEngine2;
SKSpriteNode *planeWheels;
SKSpriteNode *planeWindows;

SKTextureAtlas *plane1Atlas = [SKTextureAtlas atlasNamed:@"planeAtlas"];
planeCore = [SKSpriteNode spriteNodeWithTexture:[plane1Atlas textureNamed:@"plane1Core1"]];
planeCore.position = CGPointZero;
planeCore.zPosition = 500;
[self addChild:planeCore];
Run Code Online (Sandbox Code Playgroud)

jim*_*jim 0

在某些说明中,它说添加“新文件夹”,然后添加图像。

我遇到了同样的问题,解决了;

删除文件夹。添加新的 Sprite 图集(XCode,在大纲视图中右键单击)将图像添加到该新图集。