言語: 日本語
  • C#
  • JS
  • Boo

スクリプト言語

お好みのスクリプト言語を選択すると、サンプルコードがその言語で表示されます。

WebCamTexture.deviceName

public var deviceName: string;

Description

使用しているデバイス名

This only has an effect when set while the camera is not running. Note: if you want to use WebCamTexture to get the camera stream from device connected through Unity Remote, then you must initalize it through the constructor. It's not possible to change device using WebCamTexture.deviceName from regular devices to remote devices and vice versa.

	// Sets the device of the WebCamTexture to the first one available and starts playing it
	function Start () {
		var devices : WebCamDevice[] = WebCamTexture.devices;
		var webcamTexture : WebCamTexture = WebCamTexture();
		if(devices.length > 0){
            webcamTexture.deviceName = devices[0].name;
			webcamTexture.Play();
		}
	}