Class DefaultVariantSystemBase
DefaultVariantSystemBase is an abstract base class that should be used to update the default variants in
Ghost
The system must (and will be) created in both runtime and baking worlds. During baking, in particular,
the Ghost
The abstract base class already has the correct flags / update in world attributes set.
It is not necessary for the concrete implementation to specify the flags, nor the World
CREATION FLOW
All the default variant systems must be created after the Ghost
Inherited Members
Namespace: Unity.NetCode
Assembly: Unity.NetCode.dll
Syntax
[WorldSystemFilter(WorldSystemFilterFlags.BakingSystem|WorldSystemFilterFlags.ServerSimulation|WorldSystemFilterFlags.ClientSimulation|WorldSystemFilterFlags.ThinClientSimulation, WorldSystemFilterFlags.Default)]
[CreateAfter(typeof(GhostComponentSerializerCollectionSystemGroup))]
[CreateBefore(typeof(DefaultVariantSystemGroup))]
[UpdateInGroup(typeof(DefaultVariantSystemGroup))]
public abstract class DefaultVariantSystemBase : SystemBase
Remarks
You may have multiple derived systems. They'll all be read from, and conflicts will output errors at bake time, and the latest values will be used.
Methods
RegisterDefaultVariants(Dictionary<ComponentType, Rule>)
Implement this method by adding to the defaultVariants
mapping your
default type->variant Default
Declaration
protected abstract void RegisterDefaultVariants(Dictionary<ComponentType, DefaultVariantSystemBase.Rule> defaultVariants)
Parameters
Type | Name | Description |
---|---|---|
Dictionary<Component |
defaultVariants | Mapping default types to a variant. |