Version: 2017.4
public static bool RemovePlayer (short playerControllerId);

パラメーター

playerControllerIdThe local playerControllerId number to be removed.

戻り値

bool プレイヤーの削除が正常に行われた場合は true を返します。

説明

Removes the specified player ID from the game.

Both the client and the server destroy the player GameObject and remove it from the player list. The playerControllerId is scoped to this client, not global to all players or clients.

高レベル API (HLAPI) では、プレイヤーとクライアントを別個のゲームオブジェクトとして扱います。たいていの場合は、各クライアントに対して 1 プレイヤーですが、ある状況では (例えば、複数のコントローラーが 1 つのコンソールシステムに接続する場合など)、1 つの接続に対し、複数のプレイヤーゲームオブジェクトが存在する場合があります。1 つの接続に対し、複数のプレイヤーが存在する場合、playerControllerId プロパティーを使用し、それらを識別するように指示します。playerControllerId は接続に限定した ID で、そのクライアント上のプレーヤに紐付けられたコントローラーの ID にマップされます。