docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class NetworkList<T>

    Event based NetworkVariable container for syncing Lists

    Inheritance
    object
    NetworkVariableBase
    NetworkList<T>
    Implements
    IDisposable
    Inherited Members
    NetworkVariableBase.GetBehaviour()
    NetworkVariableBase.Initialize(NetworkBehaviour)
    NetworkVariableBase.DefaultReadPerm
    NetworkVariableBase.DefaultWritePerm
    NetworkVariableBase.Name
    NetworkVariableBase.ReadPerm
    NetworkVariableBase.WritePerm
    NetworkVariableBase.SetDirty(bool)
    NetworkVariableBase.MarkNetworkBehaviourDirty()
    NetworkVariableBase.CanClientRead(ulong)
    NetworkVariableBase.CanClientWrite(ulong)
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: Unity.Netcode
    Assembly: solution.dll
    Syntax
    [GenerateSerializationForGenericParameter(0)]
    public class NetworkList<T> : NetworkVariableBase, IDisposable where T : unmanaged, IEquatable<T>
    Type Parameters
    Name Description
    T

    The type for the list

    Constructors

    Name Description
    NetworkList()

    Constructor method for NetworkList

    NetworkList(IEnumerable<T>, NetworkVariableReadPermission, NetworkVariableWritePermission)

    Properties

    Name Description
    Count
    this[int]
    LastModifiedTick

    This is actually unused left-over from a previous interface

    Methods

    Name Description
    Add(T)
    Clear()
    Contains(T)
    Dispose()

    Overridden IDisposable implementation. CAUTION: If you derive from this class and override the Dispose() method, you must always invoke the base.Dispose() method!

    GetEnumerator()
    IndexOf(T)
    Insert(int, T)
    IsDirty()

    Gets Whether or not the container is dirty

    ReadDelta(FastBufferReader, bool)

    Reads delta from the reader and applies them to the internal value

    ReadField(FastBufferReader)

    Reads the complete state from the reader and applies it

    Remove(T)
    RemoveAt(int)
    ResetDirty()

    Resets the dirty state and marks the variable as synced / clean

    WriteDelta(FastBufferWriter)

    Writes the dirty changes, that is, the changes since the variable was last dirty, to the writer

    WriteField(FastBufferWriter)

    Writes the complete state of the variable to the writer

    Events

    Name Description
    OnListChanged

    The callback to be invoked when the list gets changed

    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)