Class GhostComponentVariationAttribute
Generate a serialization variant for a component using the Ghost
Note: This is incompatible with any type implementing Dont
Implements
Inherited Members
Namespace: Unity.NetCode
Assembly: solution.dll
Syntax
[AttributeUsage(AttributeTargets.Struct)]
public class GhostComponentVariationAttribute : Attribute, _Attribute
Constructors
Name | Description |
---|---|
Ghost |
Initialize and declare the variant for a given component type. We can't constrain on a specific interface, thus, the validation is done at compile time in the constructor (for now). |
Fields
Name | Description |
---|---|
Component |
Type that this variant is overriding. Assigned at construction time. |
Properties
Name | Description |
---|---|
Display |
User friendly, readable name for the variant. Used mainly for UI and logging purposes. If not assigned at construction time, the annotated class name will be used instead. "Default", "ClientOnly" and "DontSerialize" are not valid names and will be treated as null. |
Is |
True if editor-only. Hides it in the user-facing dropdown. If true; we'll set this variant as the default in the editor, assuming we're unable to find a "proper" default. |
Variant |
The unique hash for the component variation.
The hash is computed at compile time (assigned to the generated serialization class) and
then assigned at runtime to the attribute when all the variant are
registered by the Ghost |