问题描述
我一直在使用SpriteKit与Xcode 6 GM进行游戏,出于某种原因,我的.SKS粒子文件现在正在崩溃,这使得它们无法打开。我还注意到,当使用NSKeyedUnarchiver未实现时,崩溃Xcode的文件也会崩溃我的应用程序。所以我假设在崩溃的情况下,我的一些SKS文件已经腐败了。对于我所有损坏的SKS粒子文件,除了重新开始之外,还有什么解决方案吗?我可以通过外部编辑器以某种方式手动修改SKS文件并解决问题吗?还有我可以采取的任何步骤,以确保我的SKS文件不会再次损坏(即Xcode 6中有一些我应该知道导致损坏的SKS文件的错误。)
I've been making a game with Xcode 6 GM using SpriteKit, and for some reason out of the blue a number of my .SKS particle files are now crashing Xcode which makes them impossible to open. I've also noticed that the files that are crashing Xcode are also crashing my App when unachieved using the NSKeyedUnarchiver. So I'm assuming that given the circumstances of the crashes, some of my SKS files have become corrupt. Is there any resolution to this other than starting from scratch all over again for all of my corrupt SKS particle files? Can I somehow manually modify the SKS files through an external editor and fix the issue? Also are there any steps I can take in the future to ensure my SKS files don't become corrupted again (i.e. is there some bug in Xcode 6 that I should be aware of that's causing corrupted SKS files).
编辑:看来Xcode将这些文件视为场景,而不是导致崩溃的粒子文件。因此,由于某些原因,Xcode 6 GM Sprite Kit Editor无法正确保留文件格式,导致粒子文件被保存为场景文件,从而导致文件损坏。
Edit: It appears Xcode is treating these files as Scenes rather than particle files which is leading to the crashes. So for some reason the Xcode 6 GM Sprite Kit Editor is not preserving file format correctly which is leading to particle files being saved as scene files resulting in a corrupted file.
推荐答案
不要在Xcode 6 GM中打开你的SKS粒子文件!有一个错误导致它们被保存为SKScenes,导致文件损坏。
Do NOT open your SKS particle files in Xcode 6 GM! There is a bug that is causing them to be saved as SKScenes, which leads to the file becoming corrupt.
你需要下载Xcode 6.1 beta来修复Apple的bug精灵工具包编辑器。
You need to download Xcode 6.1 beta which fixes the bug in Apple's sprite kit editor.
但是,如果您的文件已损坏,则需要从头开始重新创建粒子SKS文件。但是,如果你有像我这样的备份,你将不需要这样做。
However, if your file is already corrupted you will need to recreate the particle SKS file from scratch. But if you have a backup like I did you won't need to do this.
但如果你没有备份,这里有一个帮助你的提示查看损坏的发射器的属性,以便快速重新创建SKS文件。如果右键单击损坏的SKS文件并在Sprite Kit Editor中打开,Xcode将不会崩溃,因为它实际上会选择错误地包裹发射器的场景。从那里你可以查看发射器的属性。然后我会拍照,以便现在当您重新创建SKS文件时,您可以再次快速设置其属性。请记住,您不能单击右键单击并在Sprite Kit Editor中打开所需的文件。
But if you don't have a backup, here is a tip for helping you to view your properties of your corrupt emitter so you quickly recreate the SKS file. If you right click your corrupt SKS file and open in Sprite Kit Editor, Xcode will not crash because it will actually select the scene that it incorrectly wrapped your emitter in. And from there you can view the properties of your emitter. I would then take a picture so that now when you recreate the SKS file you can quickly set its properties again. Remember you can't just click the file you need to right click and open in Sprite Kit Editor.
将来我建议大家按原样备份您的SKS文件在整个Xcode 6测试版中一直都很麻烦,而GM中的这个主要错误是不可接受的。我也不会为你的场景使用SKS文件,因为我有一些奇怪的错误和崩溃,你想要的最后一件事是必须重新创建一个完整的场景! SKS文件可能很有用,但它们尚未准备好发布IMO。因此,要么连续备份SKS文件,要么以编程方式创建场景和发射器,直到Sprite Kit Editor变得更稳定。
In the future I suggest everyone backup your SKS files as they are and have been very buggy throughout the Xcode 6 betas, and this major bug in the GM is unacceptable. I would also stay away from using SKS files for your scenes because I've had some strange bugs and crashes and the last thing you want is to have to recreate an entire scene! The SKS files can be useful but they weren't ready for release IMO. So either continuously backup your SKS files or just make your scenes and emitters programmatically until Sprite Kit Editor becomes more stable.
这篇关于无法打开粒子SKS文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!