docs.unity.cn
    Show / Hide Table of Contents

    Class GhostComponentAttribute

    This attribute can be used to tag components to control which ghost prefab variants they are included in and where they are sent for owner predicted ghosts.

    Inheritance
    Object
    Attribute
    GhostComponentAttribute
    Inherited Members
    Attribute.GetCustomAttributes(MemberInfo, Type)
    Attribute.GetCustomAttributes(MemberInfo, Type, Boolean)
    Attribute.GetCustomAttributes(MemberInfo)
    Attribute.GetCustomAttributes(MemberInfo, Boolean)
    Attribute.IsDefined(MemberInfo, Type)
    Attribute.IsDefined(MemberInfo, Type, Boolean)
    Attribute.GetCustomAttribute(MemberInfo, Type)
    Attribute.GetCustomAttribute(MemberInfo, Type, Boolean)
    Attribute.GetCustomAttributes(ParameterInfo)
    Attribute.GetCustomAttributes(ParameterInfo, Type)
    Attribute.GetCustomAttributes(ParameterInfo, Type, Boolean)
    Attribute.GetCustomAttributes(ParameterInfo, Boolean)
    Attribute.IsDefined(ParameterInfo, Type)
    Attribute.IsDefined(ParameterInfo, Type, Boolean)
    Attribute.GetCustomAttribute(ParameterInfo, Type)
    Attribute.GetCustomAttribute(ParameterInfo, Type, Boolean)
    Attribute.GetCustomAttributes(Module, Type)
    Attribute.GetCustomAttributes(Module)
    Attribute.GetCustomAttributes(Module, Boolean)
    Attribute.GetCustomAttributes(Module, Type, Boolean)
    Attribute.IsDefined(Module, Type)
    Attribute.IsDefined(Module, Type, Boolean)
    Attribute.GetCustomAttribute(Module, Type)
    Attribute.GetCustomAttribute(Module, Type, Boolean)
    Attribute.GetCustomAttributes(Assembly, Type)
    Attribute.GetCustomAttributes(Assembly, Type, Boolean)
    Attribute.GetCustomAttributes(Assembly)
    Attribute.GetCustomAttributes(Assembly, Boolean)
    Attribute.IsDefined(Assembly, Type)
    Attribute.IsDefined(Assembly, Type, Boolean)
    Attribute.GetCustomAttribute(Assembly, Type)
    Attribute.GetCustomAttribute(Assembly, Type, Boolean)
    Attribute.Equals(Object)
    Attribute.GetHashCode()
    Attribute.Match(Object)
    Attribute.IsDefaultAttribute()
    Attribute._Attribute.GetTypeInfoCount(UInt32)
    Attribute._Attribute.GetTypeInfo(UInt32, UInt32, IntPtr)
    Attribute._Attribute.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr)
    Attribute._Attribute.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr)
    Attribute.TypeId
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: Unity.NetCode
    Syntax
    [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct)]
    public class GhostComponentAttribute : Attribute, _Attribute

    Properties

    OwnerSendType

    Get or sets if a component should be be sent to the prediction owner or not. Some combination of the parameters and OwnerSendType may result in an error or warning at code-generation time.

    Declaration
    public SendToOwnerType OwnerSendType { get; set; }
    Property Value
    Type Description
    SendToOwnerType

    PrefabType

    Gets or sets the type of prefab where this component should be included on the main entity of the prefab.

    Declaration
    public GhostPrefabType PrefabType { get; set; }
    Property Value
    Type Description
    GhostPrefabType

    SendDataForChildEntity

    Denotes whether or not this component - when added to a child entity - should send (i.e. replicate) its data. The default behaviour is that Netcode will NOT replicate component and buffer data on children. Why not? It's expensive, as it involves finding child entities in other chunks. Thus, setting this flag to true will enable this (more expensive) serialization of child entities (unless overridden via another "Variant"). Setting to false has no effect (as is the default).

    Declaration
    public bool SendDataForChildEntity { get; set; }
    Property Value
    Type Description
    Boolean

    SendTypeOptimization

    Gets or sets the type of ghost this component should be sent to if the ghost is owner predicted. Formerly: "OwnerPredictedSendType".

    Declaration
    public GhostSendType SendTypeOptimization { get; set; }
    Property Value
    Type Description
    GhostSendType
    Back to top Copyright © 2023 Unity Technologies — Terms of use
    Generated by DocFX
    on Wednesday, June 21, 2023