ObserverViewCustomVirtualDisplay.cs 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. /****************************************************************************
  2. * Copyright 2019 Nreal Techonology Limited. All rights reserved.
  3. *
  4. * This file is part of NRSDK.
  5. *
  6. * https://www.nreal.ai/
  7. *
  8. *****************************************************************************/
  9. namespace NRKernal.Experimental.StreammingCast
  10. {
  11. using UnityEngine;
  12. using UnityEngine.UI;
  13. /// <summary> An observer view custom virtual display. </summary>
  14. public class ObserverViewCustomVirtualDisplay : MonoBehaviour
  15. {
  16. /// <summary> The show control. </summary>
  17. public Button showBtn;
  18. /// <summary> The hide control. </summary>
  19. public Button hideBtn;
  20. /// <summary> The base controller panel. </summary>
  21. public GameObject baseControllerPanel;
  22. /// <summary> Starts this object. </summary>
  23. private void Start()
  24. {
  25. showBtn.onClick.AddListener(() => { SetBaseControllerEnabled(true); });
  26. hideBtn.onClick.AddListener(() => { SetBaseControllerEnabled(false); });
  27. }
  28. /// <summary> Sets base controller enabled. </summary>
  29. /// <param name="isEnabled"> True if is enabled, false if not.</param>
  30. private void SetBaseControllerEnabled(bool isEnabled)
  31. {
  32. baseControllerPanel.SetActive(isEnabled);
  33. }
  34. }
  35. }