Core
NetworkVariable<T>
Replicated field, NGO-style: declare it on a NetworkBehaviour and Nebula discovers it.
generated from the sources
Class in namespace
Nebula · Packages/com.1by3.nebula/Runtime/Core/NetworkVariable.cspublic sealed class NetworkVariable<T> : NetworkVariableBaseReplicated field, NGO-style: declare it on a NetworkBehaviour and Nebula discovers it. Only the authoritative worker may assign Value; every other copy (ghosts on neighbouring workers, clients) receives it and raises OnValueChanged.
public NetworkVariable<float> Health = new NetworkVariable<float>(100f);Constructors
NetworkVariable
public NetworkVariable();
public NetworkVariable(T initialValue);Properties
Value
public T Value { get; set; }Events
OnValueChanged
public event Action<T, T> OnValueChanged;Methods
Write
public override void Write(NetworkWriter writer);Read
public override void Read(NetworkReader reader);ToString
public override string ToString();implicit operator T
public static implicit operator T(NetworkVariable<T> v);