Nebula
Core

NetworkVariableBase

Defines the serialization and change tracking used by every NetworkVariable<T>.

generated from the sources
Abstract class in namespace Nebula · Packages/com.1by3.nebula/Runtime/Core/NetworkVariable.cs
public abstract class NetworkVariableBase

Defines the serialization and change tracking used by every NetworkVariable<T>.

Properties

Name

public string Name { get; } = "";

Discovered name of this variable, "<BehaviourTypeName>.<FieldName>". Set when the entity is initialised and used to key the variable in the persistence blob (PersistentStateCodec), so a save survives fields being added, removed or reordered. Replication never sends it.

Persist

public bool Persist { get; }

The field carries PersistAttribute: its value is part of the entity's saved state.

PersistDirty

public bool PersistDirty { get; }

Assigned since the last time this variable was written into a persistence blob.

SyncHistory

public bool SyncHistory { get; }

The field carries SyncHistoryAttribute: its value is snapshotted into the entity's StateHistory every recorded tick and can be read back through HistoricalState.TryGetValue<T>.

Methods

Write

public abstract void Write(NetworkWriter writer);

Read

public abstract void Read(NetworkReader reader);

On this page