我如何更改此代码以访问前置摄像头,目前它显示给我后置摄像头。?我尝试了一些不同的东西,但似乎没有用。
if (isLocalPlayer)
{
if (this.gameObject.name == "Player 1") {
WebCamTexture webcamTexture = new WebCamTexture ();
Player1Image.GetComponent<RawImage> ().texture = webcamTexture;
Player1Image.GetComponent<RawImage> ().texture = webcamTexture;
Player1Image.GetComponent<RawImage> ().material.mainTexture = webcamTexture;
webcamTexture.Play ();
} else if (this.gameObject.name == "Player 2") {
WebCamTexture webcamTexture = new WebCamTexture ();
Player2Image.GetComponent<RawImage> ().texture = webcamTexture;
Player2Image.GetComponent<RawImage> ().texture = webcamTexture;
Player2Image.GetComponent<RawImage> ().material.mainTexture = webcamTexture;
webcamTexture.Play ();
} else if (this.gameObject.name == "Player 3") {
WebCamTexture webcamTexture = new WebCamTexture ();
Player3Image.GetComponent<RawImage> ().texture = webcamTexture;
Player3Image.GetComponent<RawImage> ().texture = webcamTexture;
Player3Image.GetComponent<RawImage> ().material.mainTexture = webcamTexture;
webcamTexture.Play ();
} else if (this.gameObject.name == "Player 4") {
WebCamTexture webcamTexture = new WebCamTexture ();
Player4Image.GetComponent<RawImage> ().texture = webcamTexture;
Player4Image.GetComponent<RawImage> ().texture = webcamTexture;
Player4Image.GetComponent<RawImage> ().material.mainTexture = webcamTexture;
webcamTexture.Play ();
} else {
Debug.Log ("All slots full!");
GameObject.Destroy (this);
Network.Disconnect ();
}
}