Class GhostComponentVariationAttribute
Generate a serialization variantion for a component using the GhostFieldAttribute annotations
present in variant declaration.
The component variant can be assigned at authoring time using the GhostAuthoringComponent editor.
When declaring a variant, all fields that should be serialized must be declared. Any missing field or new field
not present in the original struct will not be serialized.
Inheritance
GhostComponentVariationAttribute
Syntax
[AttributeUsage(AttributeTargets.Struct)]
public class GhostComponentVariationAttribute : Attribute, _Attribute
Constructors
GhostComponentVariationAttribute(Type, String)
Initialize and declare the variant for a given component type.
Declaration
public GhostComponentVariationAttribute(Type componentType, string displayName = null)
Parameters
Type |
Name |
Description |
Type |
componentType |
|
String |
displayName |
|
Exceptions
Fields
ComponentType
Declaration
public readonly Type ComponentType
Field Value
Properties
DisplayName
User friendly name for the variation. Used mainly for UI and logging purpose.
If not assigned at construction time, the annotated class name will be used instead.
Declaration
public string DisplayName { get; }
Property Value
VariantHash
Declaration
public ulong VariantHash { get; }
Property Value