Struct GhostAuthoringInspectionComponent.ComponentOverride
Saved override values for a single (entity, component) pair on a Ghost Prefab.
Implements
Inherited Members
Namespace: Unity.NetCode
Assembly: Unity.NetCode.Authoring.Hybrid.dll
Syntax
[Serializable]
public struct GhostAuthoringInspectionComponent.ComponentOverride : IComparer<GhostAuthoringInspectionComponent.ComponentOverride>, IComparable<GhostAuthoringInspectionComponent.ComponentOverride>
Fields
EntityIndex
The entity guid index reference.
Declaration
[FormerlySerializedAs("EntityGuid")]
public ulong EntityIndex
Field Value
| Type | Description |
|---|---|
| ulong |
FullTypeName
For sake of serialization we are using the type fullname because we can't rely on the TypeIndex for the component. StableTypeHash cannot be used either because layout or fields changes affect the hash too (so is not a good candidate for that).
Declaration
public string FullTypeName
Field Value
| Type | Description |
|---|---|
| string |
NoOverride
Sentinel for an unset PrefabType or SendTypeOptimization: -1 (cast to the relevant enum).
Declaration
public const int NoOverride = -1
Field Value
| Type | Description |
|---|---|
| int |
PrefabType
Override what modes are available for that type. If None, this component is removed from the prefab/entity instance.
Declaration
public GhostPrefabType PrefabType
Field Value
| Type | Description |
|---|---|
| GhostPrefabType |
Remarks
Note that VariantHash can clobber this value.
SendTypeOptimization
Override which client type it will be sent to, if we're able to determine.
Declaration
[FormerlySerializedAs("OwnerPredictedSendType")]
public GhostSendType SendTypeOptimization
Field Value
| Type | Description |
|---|---|
| GhostSendType |
VariantHash
Select which variant we would like to use. 0 means the default. Compute via ResolveVariantHashFromType(Type, ComponentType) (which honors well-known special variants like DontSerializeVariant), or UncheckedVariantHashNBC(Type, ComponentType) when you already know the variant is a user-defined struct.
Declaration
public ulong VariantHash
Field Value
| Type | Description |
|---|---|
| ulong |
Properties
DidCorrectlyMap
Editor-only flag set during inspection-component validation to mark that this entry mapped to a known component type. Not serialized, not meaningful at runtime.
Declaration
public readonly bool DidCorrectlyMap { get; }
Property Value
| Type | Description |
|---|---|
| bool |
HasOverriden
True if any of PrefabType, SendTypeOptimization, or VariantHash is set.
Declaration
public bool HasOverriden { get; }
Property Value
| Type | Description |
|---|---|
| bool |
IsPrefabTypeOverriden
True if PrefabType is set (not equal to NoOverride).
Declaration
public bool IsPrefabTypeOverriden { get; }
Property Value
| Type | Description |
|---|---|
| bool |
IsSendTypeOptimizationOverriden
True if SendTypeOptimization is set (not equal to NoOverride).
Declaration
public bool IsSendTypeOptimizationOverriden { get; }
Property Value
| Type | Description |
|---|---|
| bool |
IsVariantOverriden
True if VariantHash is non-zero.
Declaration
public bool IsVariantOverriden { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Methods
Compare(ComponentOverride, ComponentOverride)
Sort order: by FullTypeName, then EntityIndex, then VariantHash.
Declaration
public int Compare(GhostAuthoringInspectionComponent.ComponentOverride x, GhostAuthoringInspectionComponent.ComponentOverride y)
Parameters
| Type | Name | Description |
|---|---|---|
| GhostAuthoringInspectionComponent.ComponentOverride | x | First override to compare. |
| GhostAuthoringInspectionComponent.ComponentOverride | y | Second override to compare. |
Returns
| Type | Description |
|---|---|
| int | Negative if |
CompareTo(ComponentOverride)
Declaration
public int CompareTo(GhostAuthoringInspectionComponent.ComponentOverride other)
Parameters
| Type | Name | Description |
|---|---|---|
| GhostAuthoringInspectionComponent.ComponentOverride | other |
Returns
| Type | Description |
|---|---|
| int |
Reset()
Resets PrefabType, SendTypeOptimization, and VariantHash back to "no override". Does not touch FullTypeName or EntityIndex.
Declaration
public void Reset()