12345678910111213141516171819202122232425262728293031323334 |
- using NRKernal;
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.UI;
- public class XRRGBCamera : MonoBehaviour
- {
- public Texture CaptureImage;
- NRRGBCamTexture RGBCamTexture;
- private void Start()
- {
- RGBCamTexture = new NRRGBCamTexture();
- playCamera();
- }
- public void playCamera()
- {
- CaptureImage = RGBCamTexture.GetTexture();
- if(this.GetComponent<RawImage>()!=null)
- {
- this.GetComponent<RawImage>().texture = CaptureImage;
- this.GetComponent<RawImage>().transform.localEulerAngles = new Vector3(-180,0,0);
- }
- RGBCamTexture.Play();
- }
- public void stopCamera()
- {
- RGBCamTexture.Stop();
- }
- }
|