private void ConfigureEventSystem() { if (!cachedEventSystem) { cachedEventSystem = FindObjectOfType <EventSystem>(); } if (!cachedVRInputModule) { cachedVRInputModule = SetEventSystem(cachedEventSystem); } if (cachedEventSystem && cachedVRInputModule) { if (pointerEventData == null) { pointerEventData = new PointerEventData(cachedEventSystem); } StartCoroutine(WaitForPointerId()); if (!cachedVRInputModule.pointers.Contains(this)) { cachedVRInputModule.pointers.Add(this); } } }
protected virtual void ConfigureEventSystem() { if (cachedEventSystem == null) { cachedEventSystem = FindObjectOfType <EventSystem>(); } if (cachedVRInputModule == null) { cachedVRInputModule = SetEventSystem(cachedEventSystem); } if (cachedEventSystem != null && cachedVRInputModule != null) { if (pointerEventData == null) { pointerEventData = new PointerEventData(cachedEventSystem); } if (!cachedVRInputModule.pointers.Contains(this)) { cachedVRInputModule.pointers.Add(this); } } }
protected override void OnEnable() { previousEventSystem = current; if (previousEventSystem != null) { previousEventSystem.enabled = false; CopyValuesFrom(previousEventSystem, this); } vrInputModule = gameObject.AddComponent <VRTK_VRInputModule>(); base.OnEnable(); StartCoroutine(SetEventSystemOfBaseInputModulesAfterFrameDelay(this)); }
public void UnregisterVRInputModule(VRTK_VRInputModule vrInputModule) { vrInputModules.Remove(vrInputModule); }
public void RegisterVRInputModule(VRTK_VRInputModule vrInputModule) { vrInputModules.Add(vrInputModule); }