Class NetworkVariableBase
Interface for network value containers
#
InheritanceSystem.Object
NetworkVariableBase
NetworkList\<T>
NetworkVariable\<T>
#
ImplementsSystem.IDisposable
#
Inherited MembersSystem.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
#
Namespace: Unity.Netcode#
Assembly: MLAPI.dll#
Syntax#
Constructors#
NetworkVariableBase(NetworkVariableReadPermission, NetworkVariableWritePermission)The default constructor for NetworkVariableBase that can be used to create a custom NetworkVariable.
#
Declaration#
ParametersType | Name | Description |
---|---|---|
NetworkVariableReadPermission | readPerm | the NetworkVariableReadPermission access settings |
NetworkVariableWritePermission | writePerm | the NetworkVariableWritePermission access settings |
#
Fields#
DefaultReadPermThe default read permissions
#
Declaration#
Field ValueType | Description |
---|---|
NetworkVariableReadPermission |
#
DefaultWritePermThe default write permissions
#
Declaration#
Field ValueType | Description |
---|---|
NetworkVariableWritePermission |
#
ReadPermThe read permission for this var
#
Declaration#
Field ValueType | Description |
---|---|
NetworkVariableReadPermission |
#
WritePermThe write permission for this var
#
Declaration#
Field ValueType | Description |
---|---|
NetworkVariableWritePermission |
#
Properties#
NameGets or sets the name of the network variable's instance (MemberInfo) where it was declared.
#
Declaration#
Property ValueType | Description |
---|---|
System.String |
#
Methods#
CanClientRead(UInt64)Gets if a specific client has permission to read the var or not
#
Declaration#
ParametersType | Name | Description |
---|---|---|
System.UInt64 | clientId | The client id |
#
ReturnsType | Description |
---|---|
System.Boolean | Whether or not the client has permission to read |
#
CanClientWrite(UInt64)Gets if a specific client has permission to write the var or not
#
Declaration#
ParametersType | Name | Description |
---|---|---|
System.UInt64 | clientId | The client id |
#
ReturnsType | Description |
---|---|
System.Boolean | Whether or not the client has permission to write |
#
Dispose()Virtual System.IDisposable implementation
#
Declaration#
Initialize(NetworkBehaviour)Initializes the NetworkVariable
#
Declaration#
ParametersType | Name | Description |
---|---|---|
NetworkBehaviour | networkBehaviour | The NetworkBehaviour the NetworkVariable belongs to |
#
IsDirty()Gets Whether or not the container is dirty
#
Declaration#
ReturnsType | Description |
---|---|
System.Boolean | Whether or not the container is dirty |
#
ReadDelta(FastBufferReader, Boolean)Reads delta from the reader and applies them to the internal value
#
Declaration#
ParametersType | Name | Description |
---|---|---|
FastBufferReader | reader | The stream to read the delta from |
System.Boolean | keepDirtyDelta | Whether or not the delta should be kept as dirty or consumed |
#
ReadField(FastBufferReader)Reads the complete state from the reader and applies it
#
Declaration#
ParametersType | Name | Description |
---|---|---|
FastBufferReader | reader | The stream to read the state from |
#
ResetDirty()Resets the dirty state and marks the variable as synced / clean
#
Declaration#
SetDirty(Boolean)Sets whether or not the variable needs to be delta synced
#
Declaration#
ParametersType | Name | Description |
---|---|---|
System.Boolean | isDirty | Whether or not the var is dirty |
#
WriteDelta(FastBufferWriter)Writes the dirty changes, that is, the changes since the variable was last dirty, to the writer
#
Declaration#
ParametersType | Name | Description |
---|---|---|
FastBufferWriter | writer | The stream to write the dirty changes to |
#
WriteField(FastBufferWriter)Writes the complete state of the variable to the writer
#
Declaration#
ParametersType | Name | Description |
---|---|---|
FastBufferWriter | writer | The stream to write the state to |
#
ImplementsSystem.IDisposable