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.
Namespace: Unity.NetCode
Syntax
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct)]
public class GhostComponentAttribute : Attribute, _Attribute
Constructors
GhostComponentAttribute()
Declaration
public GhostComponentAttribute()
Properties
OwnerPredictedSendType
Gets or sets the type of ghost this component should be sent to if the ghost is owner predicted.
Declaration
public GhostSendType OwnerPredictedSendType { get; set; }
Property Value
Type | Description |
---|---|
GhostSendType |
OwnerSendType
Get or sets to witch 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
Gets or sets if the component should send data when it is on a child entity rather than the main entity of a prefab.
Declaration
public bool SendDataForChildEntity { get; set; }
Property Value
Type | Description |
---|---|
Boolean |