VR Development Framework
v 1.0.0
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events Pages
void AVR.UI.AVR_UIInteractionProvider.set ( )
inlineprivate

Definition at line 81 of file AVR_UIInteractionProvider.cs.

81  {
82 #if AVR_NET
83  if (IsOnline && !IsOwner) return;
84 #endif
85 
86  // TODO: This is a shitty workaround. AVR_Controller.Awake() calls *after* this, so inputManager is not set on the first frame.
87  // We are retrying for 1 second.
88  if (Time.realtimeSinceStartup - stime < 1.0 && !controller.inputManager) {
89  Invoke("set", 0.0f);
90  return;
91  }
92 
93  if(currentActive) {
94  AVR_DevConsole.warn("Attempted to set UIInteractionProvider \"" + gameObject.name + "\" but another UIInteractionprovider is already active! Only one can be active at a time.");
95  currentActive.enabled = false;
96  }
97  else if(!controller.inputManager) {
98  AVR_DevConsole.error("AVR_UIInteractionProvider references a controller that has no inputmanager!");
99  return;
100  }
101  else if(!VRInput.Instance) {
102  AVR_DevConsole.error("AVR_UIInteractionProvider can only be used with a VRInput component!");
103  return;
104  }
105  currentActive = this;
106  }
AVR_ControllerInputManager inputManager
the AVR_ControllerInputManager assigned to this controller. Returns null if no inputmanager is assign...
static AVR_UIInteractionProvider currentActive
The currently active interactionprovider. NOTE: only one interactionprovider will be active at a time...