您最多选择25个主题 主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

24 行
941 B

using Unity.Netcode;
namespace LobbyRelaySample.ngo
{
/// <summary>
/// An example of a custom type serialized for use in RPC calls. This represents the state of a player as far as NGO is concerned,
/// with relevant fields copied in or modified directly.
/// </summary>
public class PlayerData : INetworkSerializable
{
public string name;
public ulong id;
public int score;
public PlayerData() { } // A default constructor is explicitly required for serialization.
public PlayerData(string name, ulong id, int score = 0) { this.name = name; this.id = id; this.score = score; }
public void NetworkSerialize<T>(BufferSerializer<T> serializer) where T : IReaderWriter
{
serializer.SerializeValue(ref name);
serializer.SerializeValue(ref id);
serializer.SerializeValue(ref score);
}
}
}