Exemplo n.º 1
0
        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);
                }
            }
        }
Exemplo n.º 2
0
        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);
                }
            }
        }
Exemplo n.º 3
0
        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));
        }
Exemplo n.º 4
0
 public void UnregisterVRInputModule(VRTK_VRInputModule vrInputModule)
 {
     vrInputModules.Remove(vrInputModule);
 }
Exemplo n.º 5
0
 public void RegisterVRInputModule(VRTK_VRInputModule vrInputModule)
 {
     vrInputModules.Add(vrInputModule);
 }