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

スクリプト言語

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

WebCamTexture.deviceName

マニュアルに切り替える
public string deviceName;

説明

使用しているデバイス名

このメソッドは、カメラが作動していないときに設定されるときのみ有効です。

注意 WebCamTexture を使用して Unity Remote 経由で接続するデバイスからのカメラ ストリームを取得する場合、コンストラクタでデバイスを初期化する必要があります。後から WebCamTexture.deviceName を使用して、普通デバイスからリモートデバイスへ、または、リモートから普通デバイスへ、デバイスを変更することはできません。

	// Sets the device of the WebCamTexture to the first one available and starts playing it
using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour { void Start() { WebCamDevice[] devices = WebCamTexture.devices; WebCamTexture webcamTexture = new WebCamTexture(); if (devices.Length > 0) { webcamTexture.deviceName = devices[0].name; webcamTexture.Play(); } } }