Version: 2021.3
言語: 日本語
NetworkBehaviour
NetworkConnection

NetworkClient

重要: UNet は非推奨のソリューションになり、現在、新しい Multiplayer とネットワーキングソリューション (Netcode for GameObjects) が開発中です。詳細は、GameObjects Web サイトの Unity Netcode を参照してください。

NetworkClient is a high-level API class that manages a network connection from a client to a server, and can send and receive messages between the client and the server. The NetworkClient class also helps to manage spawned network GameObjects, and routing of remote procedure call message and network events.

詳細は、NetworkClient のスクリプトリファレンスを参照してください。

プロパティ

プロパティ 機能
serverIP クライアントが接続しているサーバーの IP アドレス
serverPort このクライアントが接続しているサーバーのポート番号
connection NetworkClient インスタンスが使用している NetworkConnection ゲームオブジェクト
handlers 登録されているメッセージハンドラー関数
numChannels 設定された NetworkTransport QoS チャンネルの数
isConnected クライアントがサーバーに接続されている場合は True
allClients アクティブな NetworkClients (静的) のリスト
active NetworkClients のうち 1 つでもアクティブ (静的) の場合は True
NetworkBehaviour
NetworkConnection