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.
Inherited Members
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
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. |