manganese_serialization_kit v0.2.4 Manganese.SerializationKit.Structs.UnityComponent
A generic Unity component.
There are other modules for specific component types. When de/serializing with the generic Manganese.SerializationKit.Structs.UnityComponent
module, the :type
property will be inspected and the appropriate de/serializer will be used. If the component type is not known, it will use this module as a struct.
The known component types are:
Manganese.SerializationKit.Structs.UnityTransformComponent
Manganese.SerializationKit.Structs.UnityBoxColliderComponent
Deserialization
- See
from_map/1
Serialization
- See
to_map/1
Link to this section Summary
Types
The internal ID used by Unity to uniquely identify components.
A Unity component of an unknown type.
Link to this section Types
id()
id() :: pos_integer()
id() :: pos_integer()
The internal ID used by Unity to uniquely identify components.
t()
t() :: %Manganese.SerializationKit.Structs.UnityComponent{
id: id(),
type: Manganese.SerializationKit.Enumerations.UnityComponentType.t()
}
t() :: %Manganese.SerializationKit.Structs.UnityComponent{ id: id(), type: Manganese.SerializationKit.Enumerations.UnityComponentType.t() }
A Unity component of an unknown type.
t_external()
t_external() :: map()
t_external() :: map()
Link to this section Functions
from_map(params)
from_map(t_external()) :: term()
from_map(t_external()) :: term()
Deserialize a component from a map.
Note this deserialization method may return a struct of a component type-specific module.
to_map(unity_component)
to_map(term()) :: t_external()
to_map(term()) :: t_external()
Serialize a component to a map.
If a component struct of a component type-specific class is given, the appropriate serializer will be used.