Version: 2017.3

HostData.passwordProtected

切换到手册
public bool passwordProtected ;

描述

服务器是否需要密码?

using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour { void Start() { HostData[] hostData = MasterServer.PollHostList(); foreach (HostData element in hostData) { Debug.Log(element.gameName + " password protected: " + element.passwordProtected); } } }