Version: 5.3 (switch to 5.4b)
言語English
  • C#
  • JS

スクリプト言語

好きな言語を選択してください。選択した言語でスクリプトコードが表示されます。

WebCamTexture.WebCamTexture

マニュアルに切り替える
public WebCamTexture();
public WebCamTexture(int requestedWidth, int requestedHeight, int requestedFPS);
public WebCamTexture(int requestedWidth, int requestedHeight);
public WebCamTexture(string deviceName);
public WebCamTexture(string deviceName, int requestedWidth, int requestedHeight);
public WebCamTexture(string deviceName, int requestedWidth, int requestedHeight, int requestedFPS);

パラメーター

deviceName 使用しているデバイス名
requestedWidth リクエストされたテクスチャの幅
requestedHeight リクエストされたテクスチャの高さ
requestedFPS リクエストされたテクスチャのフレームレート

説明

WebCamTexture を作成する

WebCamTexture.devices を使用して、利用できるカメラ デバイスの名前のリストを取得します。デバイス名がコンストラクタに提供されない場合や、null 文字列で渡された場合は、最初に見つかったデバイスが使用されます。

パラメーターによって指定した幅、高さ、フレームレートは選択されたカメラにサポートされていない場合があります。そのような場合は、最も近い使用可能な値が使用されます。

注意 WebCamTextures を Web Player で使用する場合、ユーザーの許可が必要です。 WebCamTexture を作成する前に、Application.RequestUserAuthorization を呼び出してください。

注意 WebCamTexture を使用して Unity Remote 経由で接続されたデバイスからカメラ ストリームを再生したい場合は、そのデバイスをコンストラクタで初期化しなければなりません。後から WebCamTexture.deviceName で通常デバイスからリモート デバイス、または、リモート デバイスから通常デバイスに変更することはできません。