Network.isClient 是否客户端

static var isClient : bool

Description描述

Returns true if your peer type is client.

如果端点类型是客户端,返回true。

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
	void OnGUI() {
		if (Network.isServer)
			GUILayout.Label("Running as a server");
		else
			if (Network.isClient)
				GUILayout.Label("Running as a client");

	}
}
function OnGUI() {
	if (Network.isServer)
		GUILayout.Label("Running as a server");
	else if (Network.isClient)
		GUILayout.Label("Running as a client");
}
Page last updated: 2011-4-2