|
@@ -15,6 +15,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;
|
|
@@ -31,12 +32,13 @@ public class XRRGBCamera : SingletonMono<XRRGBCamera>
|
|
|
cameraManager.frameReceived += OnCameraFrameReceived;
|
|
|
}
|
|
|
|
|
|
- playCamera();
|
|
|
+ if(isAuto)
|
|
|
+ playCamera(1280,720);
|
|
|
}
|
|
|
|
|
|
public ARCameraManager cameraManager;
|
|
|
private Material cameraBackgroundMaterial;
|
|
|
- public void playCamera()
|
|
|
+ public void playCamera(int w, int h)
|
|
|
{
|
|
|
if (isARCamrea)
|
|
|
{
|
|
@@ -57,7 +59,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();
|