- Home /
What is the .asset format specifications ?
Hi,
I want to write in javascript a parser for a unity game project. The scene is in text and there is no problem. However, the .asset files are in binary and I do not want to spent my whole project time to find a way to parse them. For a first task, I am interested on how to parse the terrain.asset file. Any idea?
BR, Dimitrios
I want to make a web editor for Unity3D. Just the basic staff for start. The web interface will be based on Three.js. If you save the three.js scene in Unity3d format then you can compile it for every platform.
Share this idea to Unity and ask for a job to pursue this, I would use it xD
Answer by Immanuel-Scholz · Apr 13, 2016 at 02:02 PM
".asset" is used for a lot of different formats, most noticeable for Terrain data and scriptable custom assets (ScriptableObject). If you set your editor settings to "Force Text", most of the .asset files will be YAML text files.
AFAIK, Unity does not officially release the binary scheme of its data files - nor the structure of the YAML file. (probably so they can change it at will in even the minor updates)
So basically, you are out of luck.
However, one last note: There is a tool located under "unity install dir/Editor/Data/Tools/binary2text.exe" that can convert unity-binary files into text representations. Its not YAML text but some simple human readable txt format. So if you really want to reverse engineer their binary format, this might help. ;)
I 've used the "Force Text" but still the Terrain is in binary format. Luckily the binary2text.exe did the job. Now I am getting the Terrain.asset as text format. Thanks.
You can also launch Unity.exe in batch mode, have it call a specific function and then quit. So you could use Unity itself to parse some files and export them in an easier format.
Not the most performant way, of course.
I will exa$$anonymous$$e batch mode. I will need also the inverse of binary2text function because if I modified externally the terrain data as text (it is not an urgent feature though), I need to transform it back to binary terrain data.
Your answer
Follow this Question
Related Questions
Managing Scenes and reusable code 1 Answer
[SOLVED] Compiled game size 1 Answer
Create JPG to HDD from Image In Assets-Folder 0 Answers
How import textures to UNITY with "DXF File" 2 Answers
How can I unload a single resource? 2 Answers