Part serialisation

All parts in Homebrew are just serialised GameObjects, but what does this mean and how do we use it? This page will cover how to create a new placeable vehicle part for the builder.

What is serialisation?
Serialisation is kinda just a fancy way to say 'saving'. When a part (or a vehicle) is serialised all that's really happening is the existing GameObject, components, and all of its children are turned into a computer code 'recipe' on how to recreate them again, this is how both vehicle saving and vehicle parts work - they're just GameObjects that got saved into a recipe, that the game can reconstruct from a file.

What this means is that its trivial to make our own parts in Homebrew, all we need to do is set up a new GameObject (or modify an existing one) and serialise it, it will be a usable part so long as we built it correctly and included all necessary components and data.

There are limitations to serialisation though, mainly that only certain data is serialised, here are some examples:

Serialised:

 * GameObjects, names, transforms, local position/rotation/scale, children, almost all hierarchy data
 * Components
 * Some component properties, but not all. Which properties are or are not serialised is determined by the component class
 * Meshes (including verts, tris, normals, tangents, UVs, etc)
 * Material reference, but not the material itself. Only the name of the material is serialised, the name is used to find the material reference on deserialisation (reconstruction)

Not serialised:

 * Textures or materials
 * Sounds
 * Particle effects