Utility 类,用于发送只包含一个整数的简单网络消息。
using UnityEngine; using UnityEngine.Networking; using UnityEngine.Networking.NetworkSystem;
public class Test { void SendValue(int value) { var msg = new IntegerMessage(value); NetworkServer.SendToAll(MsgType.Scene, msg); } }