Method group is Obsolete

StringMessage

class in UnityEngine.Networking.NetworkSystem

/

继承自:Networking.MessageBase

切换到手册
Obsolete

描述

这是一个 Utility 类,用于只包含一个字符串的简单网络消息。

此示例发送一条包含场景名称的消息。

using UnityEngine;
using UnityEngine.Networking;
using UnityEngine.Networking.NetworkSystem;

public class Test { void SendSceneName(string sceneName) { var msg = new StringMessage(sceneName); NetworkServer.SendToAll(MsgType.Scene, msg); } }

继承的成员