|
@@ -10,6 +10,7 @@ public class XRRGBCamera : SingletonMono<XRRGBCamera>
|
|
|
public static XRRGBCamera Instance;
|
|
|
public Texture CaptureImage;
|
|
|
public WebCamTexture RGBCamTexture;
|
|
|
+ public bool isAuto = true;
|
|
|
private void Awake()
|
|
|
{
|
|
|
Instance = this;
|
|
@@ -17,10 +18,11 @@ public class XRRGBCamera : SingletonMono<XRRGBCamera>
|
|
|
private void Start()
|
|
|
{
|
|
|
|
|
|
- playCamera();
|
|
|
+ if(isAuto)
|
|
|
+ playCamera(1280,720);
|
|
|
}
|
|
|
|
|
|
- public void playCamera()
|
|
|
+ public void playCamera(int w,int h)
|
|
|
{
|
|
|
if (RGBCamTexture != null && RGBCamTexture.isPlaying)
|
|
|
{
|
|
@@ -37,7 +39,7 @@ public class XRRGBCamera : SingletonMono<XRRGBCamera>
|
|
|
}
|
|
|
|
|
|
|
|
|
- RGBCamTexture = new WebCamTexture(devices[0].name, 1280, 720, 30);
|
|
|
+ RGBCamTexture = new WebCamTexture(devices[0].name, w, h, 30);
|
|
|
Debug.Log("开启摄像头" + devices[0].name);
|
|
|
|
|
|
RGBCamTexture.Play();
|