Assignment for RMIT Mixed Reality in 2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

48 lines
982 B

  1. //======= Copyright (c) Valve Corporation, All rights reserved. ===============
  2. //
  3. // Purpose: Debug UI shown for the player
  4. //
  5. //=============================================================================
  6. using UnityEngine;
  7. using UnityEngine.UI;
  8. using System.Collections;
  9. namespace Valve.VR.InteractionSystem
  10. {
  11. //-------------------------------------------------------------------------
  12. public class DebugUI : MonoBehaviour
  13. {
  14. private Player player;
  15. //-------------------------------------------------
  16. static private DebugUI _instance;
  17. static public DebugUI instance
  18. {
  19. get
  20. {
  21. if ( _instance == null )
  22. {
  23. _instance = GameObject.FindObjectOfType<DebugUI>();
  24. }
  25. return _instance;
  26. }
  27. }
  28. //-------------------------------------------------
  29. void Start()
  30. {
  31. player = Player.instance;
  32. }
  33. //-------------------------------------------------
  34. private void OnGUI()
  35. {
  36. #if !HIDE_DEBUG_UI
  37. player.Draw2DDebug();
  38. #endif
  39. }
  40. }
  41. }