docs.unity3d.com
    Show / Hide Table of Contents

    Class DefaultVariantSystemBase

    DefaultVariantSystemBase is an abstract base class that should be used to update the default variants in GhostComponentSerializerCollectionSystemGroup, witch contains what serialization variant to use (GhostComponentVariationAttribute) for certain type. A concrete implementation must implements the RegisterDefaultVariants(Dictionary<ComponentType, Type>) method and add to the dictionary the desired type-variant pairs.

    The system must and will be created in both runtime and conversion worlds. During conversion, in particular, the GhostComponentSerializerCollectionSystemGroup is used by the GhostAuthoringConversion to configure the ghost prefabs metadata with the defaults values.

    The abstract base class already has the correct flags / update in world attributes set. It is not necessary for the concrete implementation to specify neither the flags or the update in world.

    There is also no particular restriction in witch group the system need run into since all data needed by the runtime is created inside the OnCreate method. As a general rule, if you really need to add an UpdateInGroup attribute, please use only the SimulationSystemGroup as target.

    Inheritance
    Object
    ComponentSystemBase
    ComponentSystem
    DefaultVariantSystemBase
    Inherited Members
    ComponentSystem.InitEntityQueryCache(Int32)
    ComponentSystem.Update()
    ComponentSystem.PostUpdateCommands
    ComponentSystem.Entities
    ComponentSystemBase.OnCreateForCompiler()
    ComponentSystemBase.OnStartRunning()
    ComponentSystemBase.OnStopRunning()
    ComponentSystemBase.OnDestroy()
    ComponentSystemBase.ShouldRunSystem()
    ComponentSystemBase.GetComponentTypeHandle<T>(Boolean)
    ComponentSystemBase.GetDynamicComponentTypeHandle(ComponentType)
    ComponentSystemBase.GetBufferTypeHandle<T>(Boolean)
    ComponentSystemBase.GetSharedComponentTypeHandle<T>()
    ComponentSystemBase.GetDynamicSharedComponentTypeHandle(ComponentType)
    ComponentSystemBase.GetEntityTypeHandle()
    ComponentSystemBase.GetComponentDataFromEntity<T>(Boolean)
    ComponentSystemBase.GetBufferFromEntity<T>(Boolean)
    ComponentSystemBase.GetStorageInfoFromEntity()
    ComponentSystemBase.RequireForUpdate(EntityQuery)
    ComponentSystemBase.RequireSingletonForUpdate<T>()
    ComponentSystemBase.HasSingleton<T>()
    ComponentSystemBase.GetSingleton<T>()
    ComponentSystemBase.TryGetSingleton<T>(T)
    ComponentSystemBase.SetSingleton<T>(T)
    ComponentSystemBase.GetSingletonEntity<T>()
    ComponentSystemBase.TryGetSingletonEntity<T>(Entity)
    ComponentSystemBase.GetEntityQuery(ComponentType[])
    ComponentSystemBase.GetEntityQuery(NativeArray<ComponentType>)
    ComponentSystemBase.GetEntityQuery(EntityQueryDesc[])
    ComponentSystemBase.GetEntityQuery(EntityQueryDescBuilder)
    ComponentSystemBase.Enabled
    ComponentSystemBase.EntityQueries
    ComponentSystemBase.GlobalSystemVersion
    ComponentSystemBase.LastSystemVersion
    ComponentSystemBase.EntityManager
    ComponentSystemBase.World
    ComponentSystemBase.SystemHandleUntyped
    ComponentSystemBase.Time
    Namespace: Unity.NetCode
    Syntax
    [WorldSystemFilter(WorldSystemFilterFlags.Default | WorldSystemFilterFlags.GameObjectConversion)]
    [UpdateInWorld(TargetWorld.ClientAndServer)]
    public abstract class DefaultVariantSystemBase : ComponentSystem

    Methods

    OnCreate()

    Declaration
    protected sealed override void OnCreate()
    Overrides
    ComponentSystemBase.OnCreate()

    OnUpdate()

    Declaration
    protected sealed override void OnUpdate()
    Overrides
    ComponentSystem.OnUpdate()

    RegisterDefaultVariants(Dictionary<ComponentType, Type>)

    Implement this method by adding to the dictionary your default type->variant mapping

    Declaration
    protected abstract void RegisterDefaultVariants(Dictionary<ComponentType, Type> defaultVariants)
    Parameters
    Type Name Description
    Dictionary<ComponentType, Type> defaultVariants
    Back to top
    Terms of use
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023