TNet 3  3.0.8
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Macros
TNet.ComponentSerialization Class Reference

This class contains DataNode serialization methods for Unity components that make it possible to serialize behaviours and game objects. More...

Static Public Member Functions

static void Serialize (this Component c, DataNode node, Type type=null)
 Generic component serialization function. You can add custom serialization to any component by adding an extension with this signature: static public void Serialize (this YourComponentType, DataNode); More...
 
static void Deserialize (this Component c, DataNode node)
 Generic deserialization function. You can create a custom deserialization for your components by adding an extension method with this signature: static public void Deserialize (this YourComponentType, DataNode); More...
 
static void Serialize (this Rigidbody rb, DataNode node)
 Rigidbody class has a lot of properties that don't need to be serialized. More...
 
static void Serialize (this Camera cam, DataNode node)
 Camera serialization skips a bunch of values such as "layerCullDistances", "stereoSeparation", and more. More...
 
static void Serialize (this Material mat, DataNode node)
 Serialize the specified material into its DataNode format. More...
 
static void Serialize (this Material mat, DataNode node, bool serializeTextures)
 Serialize the specified material into its DataNode format. More...
 
static void Deserialize (this Renderer ren, DataNode data)
 Deserialize a previously serialized renderer. More...
 
static Material DeserializeMaterial (this DataNode matNode)
 Deserialize a previously serialized material. More...
 
static void Serialize (this MeshFilter filter, DataNode data)
 Serialize the Mesh Filter component. More...
 
static void Deserialize (this MeshFilter filter, DataNode data)
 Restore a previously serialized Mesh Filter component. More...
 
static void Serialize (this Mesh mesh, DataNode node)
 Serialize the entire mesh into the specified DataNode. More...
 
static Mesh DeserializeMesh (this DataNode node)
 Set the mesh from the specified DataNode. More...
 
static void Serialize (this Texture tex, DataNode node)
 Serialize the entire texture into the specified DataNode. More...
 
static Texture DeserializeTexture (this DataNode node)
 Deserialize the texture that was previously serialized into the DataNode format. More...
 
static void SerializeSharedResources (this GameObject go, DataNode node, bool includeInactive=false)
 Collect all meshes, materials and textures underneath the specified object and serialize them into the DataNode. More...
 
static DataNode Serialize (this GameObject go, bool fullHierarchy=true, bool isRootNode=true)
 Serialize this game object into a DataNode. Note that the prefab references can only be resolved if serialized from within the Unity Editor. You can instantiate this game object directly from DataNode format by using DataNode.Instantiate(). Ideal usage: save a game object hierarchy into a file. Serializing a game object will also serialize its mesh data, making it possible to export entire 3D models. Any references to prefabs or materials located in the Resources folder will be kept as references and their hierarchy won't be serialized. More...
 
static void Deserialize (this GameObject go, DataNode root, bool includeChildren=true)
 Deserialize a previously serialized game object. More...
 
static GameObject Instantiate (this DataNode data)
 Instantiate a new game object given its previously serialized DataNode. You can serialize game objects by using GameObject.Serialize(), but be aware that serializing only works fully in the Unity Editor. Prefabs can't be located automatically outside of the Unity Editor. More...
 

Detailed Description

This class contains DataNode serialization methods for Unity components that make it possible to serialize behaviours and game objects.

Member Function Documentation

static void TNet.ComponentSerialization.Deserialize ( this Component  c,
DataNode  node 
)
static

Generic deserialization function. You can create a custom deserialization for your components by adding an extension method with this signature: static public void Deserialize (this YourComponentType, DataNode);

static void TNet.ComponentSerialization.Deserialize ( this Renderer  ren,
DataNode  data 
)
static

Deserialize a previously serialized renderer.

static void TNet.ComponentSerialization.Deserialize ( this MeshFilter  filter,
DataNode  data 
)
static

Restore a previously serialized Mesh Filter component.

static void TNet.ComponentSerialization.Deserialize ( this GameObject  go,
DataNode  root,
bool  includeChildren = true 
)
static

Deserialize a previously serialized game object.

static Material TNet.ComponentSerialization.DeserializeMaterial ( this DataNode  matNode)
static

Deserialize a previously serialized material.

static Mesh TNet.ComponentSerialization.DeserializeMesh ( this DataNode  node)
static

Set the mesh from the specified DataNode.

static Texture TNet.ComponentSerialization.DeserializeTexture ( this DataNode  node)
static

Deserialize the texture that was previously serialized into the DataNode format.

static GameObject TNet.ComponentSerialization.Instantiate ( this DataNode  data)
static

Instantiate a new game object given its previously serialized DataNode. You can serialize game objects by using GameObject.Serialize(), but be aware that serializing only works fully in the Unity Editor. Prefabs can't be located automatically outside of the Unity Editor.

static void TNet.ComponentSerialization.Serialize ( this Component  c,
DataNode  node,
Type  type = null 
)
static

Generic component serialization function. You can add custom serialization to any component by adding an extension with this signature: static public void Serialize (this YourComponentType, DataNode);

static void TNet.ComponentSerialization.Serialize ( this Rigidbody  rb,
DataNode  node 
)
static

Rigidbody class has a lot of properties that don't need to be serialized.

static void TNet.ComponentSerialization.Serialize ( this Camera  cam,
DataNode  node 
)
static

Camera serialization skips a bunch of values such as "layerCullDistances", "stereoSeparation", and more.

static void TNet.ComponentSerialization.Serialize ( this Material  mat,
DataNode  node 
)
static

Serialize the specified material into its DataNode format.

static void TNet.ComponentSerialization.Serialize ( this Material  mat,
DataNode  node,
bool  serializeTextures 
)
static

Serialize the specified material into its DataNode format.

static void TNet.ComponentSerialization.Serialize ( this MeshFilter  filter,
DataNode  data 
)
static

Serialize the Mesh Filter component.

static void TNet.ComponentSerialization.Serialize ( this Mesh  mesh,
DataNode  node 
)
static

Serialize the entire mesh into the specified DataNode.

static void TNet.ComponentSerialization.Serialize ( this Texture  tex,
DataNode  node 
)
static

Serialize the entire texture into the specified DataNode.

static DataNode TNet.ComponentSerialization.Serialize ( this GameObject  go,
bool  fullHierarchy = true,
bool  isRootNode = true 
)
static

Serialize this game object into a DataNode. Note that the prefab references can only be resolved if serialized from within the Unity Editor. You can instantiate this game object directly from DataNode format by using DataNode.Instantiate(). Ideal usage: save a game object hierarchy into a file. Serializing a game object will also serialize its mesh data, making it possible to export entire 3D models. Any references to prefabs or materials located in the Resources folder will be kept as references and their hierarchy won't be serialized.

static void TNet.ComponentSerialization.SerializeSharedResources ( this GameObject  go,
DataNode  node,
bool  includeInactive = false 
)
static

Collect all meshes, materials and textures underneath the specified object and serialize them into the DataNode.


The documentation for this class was generated from the following file: