Network.incomingPassword 入站密码

static var incomingPassword : string

Description描述

Set the password for the server (for incoming connections).

为服务器设置密码(入站连接)。

This must be matched in the Network.Connect routine on the clients. Pass "" to specify no password (this is default).

这个必须与客户端上Network.Connect中的相同,传递 "" 表示没有密码(默认)。

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
	void ConnectToServer() {
		Network.Connect("127.0.0.1", 25000, "HolyMoly");
	}
	void LaunchServer() {
		Network.incomingPassword = "HolyMoly";
		Network.InitializeServer(32, 25000);
	}
}
function ConnectToServer () {
	Network.Connect("127.0.0.1", 25000, "HolyMoly");
}

function LaunchServer () {
	Network.incomingPassword = "HolyMoly";
	Network.InitializeServer(32, 25000);
}
Page last updated: 2011-4-2