HostData.connectedPlayers 连接的玩家数

var connectedPlayers : int

Description描述

Currently connected players

当前连接的玩家数。

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
	void Start() {
		HostData[] hostData = MasterServer.PollHostList();
		foreach (HostData element in hostData) {
			Debug.Log(element.connectedPlayers + " are connected to " + element.gameName);
		}
	}
}
// Requests info from the master server and prints
// the number of players playing on each host
//从master服务器请求信息,并打印每个主机的当前玩家数

function Start() {
	var hostData : HostData[] = MasterServer.PollHostList();
	for(var element : HostData in hostData) {
		Debug.Log(element.connectedPlayers + " are connected to " + element.gameName);
	}
}
Page last updated: 2011-2-24