Tanoda
GILES.Serialization.pb_SerializableObject< T > Class Template Reference
Inheritance diagram for GILES.Serialization.pb_SerializableObject< T >:
GILES.Serialization.pb_ISerializable

Public Member Functions

 pb_SerializableObject (T obj)
 
object GetObject (string key)
 
 pb_SerializableObject (SerializationInfo info, StreamingContext context)
 
void GetObjectData (SerializationInfo info, StreamingContext context)
 
virtual void ApplyProperties (object obj)
 Called after an object is deserialized and constructed to it's base type. More...
 
virtual Dictionary< string, object > PopulateSerializableDictionary ()
 
void ApplyProperties (object obj)
 Called after an object is deserialized and constructed to it's base type. More...
 
Dictionary< string, object > PopulateSerializableDictionary ()
 

Static Public Member Functions

static operator T (pb_SerializableObject< T > obj)
 

Protected Attributes

target
 A reference to the component being serialized. Will be null on deserialization. More...
 
Dictionary< string, object > reflectedProperties
 A key-value store of all serializable properties and fields on this object. Populated on serialization & deserialization. More...
 

Properties

Type type [get, set]
 The type of component stored. More...
 
- Properties inherited from GILES.Serialization.pb_ISerializable
System.Type type [get, set]
 The type of component stored. More...
 

Detailed Description

Container class for Unity component types, used to serialize and reconstitute components. If you want to override serialization behavior for your MonoBehaviour, implement the pb_ISerializableComponent interface.

Definition at line 17 of file pb_SerializableObject.cs.

Constructor & Destructor Documentation

◆ pb_SerializableObject() [1/2]

Create a new serializable object from a component.

Definition at line 30 of file pb_SerializableObject.cs.

◆ pb_SerializableObject() [2/2]

GILES.Serialization.pb_SerializableObject< T >.pb_SerializableObject ( SerializationInfo  info,
StreamingContext  context 
)

Constructor coming from serialization.

Definition at line 68 of file pb_SerializableObject.cs.

Member Function Documentation

◆ ApplyProperties()

virtual void GILES.Serialization.pb_SerializableObject< T >.ApplyProperties ( object  obj)
virtual

Called after an object is deserialized and constructed to it's base type.

Implements GILES.Serialization.pb_ISerializable.

Definition at line 87 of file pb_SerializableObject.cs.

◆ GetObject()

object GILES.Serialization.pb_SerializableObject< T >.GetObject ( string  key)

Definition at line 53 of file pb_SerializableObject.cs.

◆ GetObjectData()

void GILES.Serialization.pb_SerializableObject< T >.GetObjectData ( SerializationInfo  info,
StreamingContext  context 
)

Serialize data for ISerializable.

Definition at line 78 of file pb_SerializableObject.cs.

◆ operator T()

static GILES.Serialization.pb_SerializableObject< T >.operator T ( pb_SerializableObject< T >  obj)
explicitstatic

Explicit cast return target. If obj is null but reflectedProperties is valid, a new instance of T is returned with those properties applied. The new instance is constructed using default(T).

Definition at line 39 of file pb_SerializableObject.cs.

◆ PopulateSerializableDictionary()

virtual Dictionary< string, object > GILES.Serialization.pb_SerializableObject< T >.PopulateSerializableDictionary ( )
virtual

Called before serialization, any properties stoed in the returned dictionary will be saved and re-applied in ApplyProperties.

Implements GILES.Serialization.pb_ISerializable.

Reimplemented in GILES.Serialization.pb_CameraComponent, GILES.Serialization.pb_MeshCollider, GILES.Serialization.pb_MeshFilter, and GILES.Serialization.pb_MeshRenderer.

Definition at line 101 of file pb_SerializableObject.cs.

Member Data Documentation

◆ reflectedProperties

Dictionary<string, object> GILES.Serialization.pb_SerializableObject< T >.reflectedProperties
protected

A key-value store of all serializable properties and fields on this object. Populated on serialization & deserialization.

Definition at line 25 of file pb_SerializableObject.cs.

◆ target

A reference to the component being serialized. Will be null on deserialization.

Definition at line 20 of file pb_SerializableObject.cs.

Property Documentation

◆ type

The type of component stored.

Implements GILES.Serialization.pb_ISerializable.

Definition at line 22 of file pb_SerializableObject.cs.


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