docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class SyncListStruct<T>

    This class is used for lists of structs that are synchronized from the server to clients.

    To use SyncListStruct, derive a new class with your struct as the generic parameter.

    Inheritance
    object
    SyncList<T>
    SyncListStruct<T>
    Implements
    IList<T>
    ICollection<T>
    IEnumerable<T>
    IEnumerable
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: UnityEngine.Networking
    Assembly: com.unity.multiplayer-hlapi.Runtime.dll
    Syntax
    [Obsolete("The high level API classes are deprecated and will be removed in the future.")]
    public class SyncListStruct<T> : SyncList<T>, IList<T>, ICollection<T>, IEnumerable<T>, IEnumerable where T : struct
    Type Parameters
    Name Description
    T

    Properties

    Count

    Declaration
    public ushort Count { get; }
    Property Value
    Type Description
    ushort

    Methods

    AddInternal(T)

    Declaration
    public void AddInternal(T item)
    Parameters
    Type Name Description
    T item

    DeserializeItem(NetworkReader)

    This method is used when deserializing SyncList items from a stream.

    Declaration
    protected override T DeserializeItem(NetworkReader reader)
    Parameters
    Type Name Description
    NetworkReader reader

    Stream to read from.

    Returns
    Type Description
    T

    New instance of the SyncList value type.

    Overrides
    SyncList<T>.DeserializeItem(NetworkReader)

    GetItem(int)

    Declaration
    public T GetItem(int i)
    Parameters
    Type Name Description
    int i
    Returns
    Type Description
    T

    SerializeItem(NetworkWriter, T)

    This is used to write a value object from a SyncList to a stream.

    Declaration
    protected override void SerializeItem(NetworkWriter writer, T item)
    Parameters
    Type Name Description
    NetworkWriter writer

    Stream to write to.

    T item

    Item to write.

    Overrides
    SyncList<T>.SerializeItem(NetworkWriter, T)

    Implements

    IList<T>
    ICollection<T>
    IEnumerable<T>
    IEnumerable
    In This Article
    Back to top
    Copyright © 2025 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)