public bool isConnected ;

描述

如果该连接已连接到远程端点,则为 true。

这适用于 NetworkServer 和 NetworkClient 连接。未连接时,hostID 将为 -1。已连接时,hostID 将为正整数。