|
@@ -7,6 +7,7 @@ using SC.XR.Unity;
|
|
|
|
|
|
public class XRRGBCamera : SingletonMono<XRRGBCamera>
|
|
|
{
|
|
|
+ public bool isAuto=true;
|
|
|
public static XRRGBCamera Instance;
|
|
|
public Texture CaptureImage;
|
|
|
public WebCamTexture RGBCamTexture;
|
|
@@ -17,10 +18,11 @@ public class XRRGBCamera : SingletonMono<XRRGBCamera>
|
|
|
private void Start()
|
|
|
{
|
|
|
|
|
|
- playCamera();
|
|
|
+ if(isAuto)
|
|
|
+ playCamera(w,h);
|
|
|
}
|
|
|
|
|
|
- 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();
|