YAML support?

I’m pretty new to unity, and was wondering if there was a way to read/write to YAML files using the Unity API.
I came from coding bukkit plugins (Minecraft Multiplayer server software) and its api had a built in feature that used yaml files. I wanted to see about using .yml files to store some data rather than player prefs or dealing with serialization. I looked on google and the unity documentation and haven’t found anything useful, any info would be nice. Thanks.

In short: no. The Unity editor uses YAML for asset serialization but only inside the editor. When you build your project all assets are stored in a binary format as it’s smaller and loads faster. The UnityEngine doesn’t include any YAML parser or generator. However there are plenty out there.

YAML is not necessarily a good choice for a serialization / data storage format. It’s quite “verbose” and if it should be editable by humans its strict structure makes it sensitive for errors. As suggested by McKenzieG1 on the SO question i would also recommend to use JSON instead as it’s much simpler and more versatile since it’s more common even it has less “features” than YAML.

ps: You said you don’t want to deal with serialization, but storing data in a text format is serializing the data. I barely programmed for Minecraft since i don’t really like Java ^^. However it seems that Minecraft itself doesn’t have support for YAML. Bukkit has added the FileConfiguration class which does this, Minecraft usually used NBT to store data which is actually very close to how PlayerPrefs are stored in a webplayer build. PlayerPrefs just don’t support any structures.

There is no built in YAML support. So youd either have to write your own implementation or use a .NET YAML library.

Most users decide to use JSON for saving and loading user data in Unity.

It’s worse than it look – it’s a modified YAML format, most yaml parsers will throw an error.

First, it’s multiple documents, separated by —

But there are also duplicate keys, and sometimes line wraps. I’m not sure how they even parse it.

For example, from a .unity (scene) file (note the link break).

  m_LightingDataAsset: {fileID: 112000001, guid: fb3c98ad753fd9d4781da879935c9e93, 
type: 2}
  m_UseShadowmask: 0
--- !u!196 &4
  serializedVersion: 2