ピアタイプの状態(切断、接続、サーバー、クライアントなど)
function OnGUI() { if (Network.peerType == NetworkPeerType.Disconnected) GUILayout.Label("Not Connected"); else if (Network.peerType == NetworkPeerType.Connecting) GUILayout.Label("Connecting"); else GUILayout.Label("Network started"); }
using UnityEngine; using System.Collections;
public class ExampleClass : MonoBehaviour { void OnGUI() { if (Network.peerType == NetworkPeerType.Disconnected) GUILayout.Label("Not Connected"); else if (Network.peerType == NetworkPeerType.Connecting) GUILayout.Label("Connecting"); else GUILayout.Label("Network started"); } }