PhoneUIRenderer.cs 652 B

12345678910111213141516171819202122232425262728
  1. using EZXR.Glass.SixDof;
  2. using AOT;
  3. using System;
  4. using System.Collections;
  5. using System.Collections.Generic;
  6. using System.Runtime.InteropServices;
  7. using UnityEngine;
  8. using UnityEngine.UI;
  9. namespace EZXR.Glass.Rendering
  10. {
  11. public class PhoneUIRenderer : MonoBehaviour
  12. {
  13. public Camera phoneUICamera;
  14. private void Start()
  15. {
  16. if (Display.displays.Length > 1)
  17. {
  18. phoneUICamera.SetTargetBuffers(Display.displays[0].colorBuffer, Display.displays[0].depthBuffer);
  19. }
  20. else
  21. {
  22. gameObject.SetActive(false);
  23. }
  24. }
  25. }
  26. }