Advertisement
Guest User

Untitled

a guest
Oct 17th, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.35 KB | None | 0 0
  1. public bool _isHeadSetConnected;
  2.     public bool isHeadSetConnected
  3.     {
  4.         get
  5.         {
  6.             return _isHeadSetConnected;
  7.         }
  8.         set
  9.         {
  10.             if(_isHeadSetConnected != value)
  11.             {
  12.                 _isHeadSetConnected = value;
  13.  
  14.                 if (_isHeadSetConnected == false && !PauseController.Instance.IsPlayerInPausePosition())
  15.                     OVRManager.HMDUnmounted += PauseController.Instance.EnablePause;
  16.                 else if (_isHeadSetConnected == true && !PauseController.Instance.IsPlayerInPausePosition())
  17.                     OVRManager.HMDMounted += PauseController.Instance.EnablePause;
  18.  
  19.                 return;
  20.             }
  21.         }
  22.     }
  23.  
  24.     public bool _isControllerConnected;
  25.     public bool isControllerConnected
  26.     {
  27.         get
  28.         {
  29.             return _isControllerConnected;
  30.         }
  31.  
  32.         set
  33.         {
  34.             if (_isControllerConnected != value)
  35.             {
  36.                 _isControllerConnected = value;
  37.  
  38.                 if (isHeadSetConnected == true) // se o headset estiver conectado, verifica se o controle está conectado e se o modal de conexão.
  39.                 {
  40.                     if (_isControllerConnected == false && Game_Manager.Instance.newGame == false && PauseController.Instance.showConnectedController == false)
  41.                     {
  42.                         PauseController.Instance.PauseGame();
  43.                         PauseController.Instance.EnableConnectionScreen(true);
  44.                         PauseController.Instance.showConnectedController = true;
  45.                     }
  46.                     else if (_isControllerConnected == true && Game_Manager.Instance.newGame == false && PauseController.Instance.showConnectedController == true)
  47.                     {
  48.                         PauseController.Instance.UnPauseGame();
  49.                         PauseController.Instance.EnableConnectionScreen(false);
  50.                         PauseController.Instance.showConnectedController = false;
  51.                     }
  52.  
  53.                     else if (_isControllerConnected == true && !isControllerSideChecked)
  54.                     {
  55.                         StartCoroutine(CheckController());
  56.                         isControllerSideChecked = true;
  57.                     }
  58.                 }
  59.                 return;
  60.             }
  61.         }
  62.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement