OvrUIViewCamera.cs 638 B

1234567891011121314151617181920212223242526272829303132
  1. using System;
  2. using UnityEngine;
  3. public class OvrUIViewCamera : MonoBehaviour
  4. {
  5. private void Start()
  6. {
  7. this.m_camera = base.GetComponent<Camera>();
  8. this.m_trPlane = base.transform.Find("Plane");
  9. this.m_camera.enabled = false;
  10. if (this.m_trPlane != null)
  11. {
  12. this.m_trPlane.gameObject.SetActive(false);
  13. }
  14. }
  15. private void Update()
  16. {
  17. if (Input.GetKeyUp(KeyCode.I) && this.m_camera != null)
  18. {
  19. this.m_camera.enabled = !this.m_camera.enabled;
  20. if (this.m_trPlane != null)
  21. {
  22. this.m_trPlane.gameObject.SetActive(this.m_camera.enabled);
  23. }
  24. }
  25. }
  26. private Camera m_camera;
  27. private Transform m_trPlane;
  28. }