Beispiel #1
0
        /// <summary>
        /// If this pointer has a null input module reference, this method will try to find an XRInputModule in the scene
        /// or create one if none exists.
        /// </summary>
        void FindOrCreateXRUIInputModule()
        {
            var eventSystem = Object.FindObjectOfType <EventSystem>();

            if (eventSystem == null)
            {
                eventSystem = new GameObject("Event System", typeof(EventSystem)).GetComponent <EventSystem>();
            }

            inputModule = eventSystem.GetComponent <XRUIInputModule>();
            if (inputModule == null)
            {
                inputModule = eventSystem.gameObject.AddComponent <XRUIInputModule>();
            }
        }
Beispiel #2
0
        void OnDisable()
        {
            inputModule.UnregisterPointer(this);

            inputModule = null;
        }