コード例 #1
0
        public void OnPointerEnter(PointerEventData e)
        {
            PointerEventData ped = e as TouchUIPointerEventData;

            if (ped != null)
            {
                // Gaze has entered this canvas. We'll make it the active one so that canvas-mouse pointer can be used.
                TouchUIInputModule inputModule = EventSystem.current.currentInputModule as TouchUIInputModule;
                inputModule.activeGraphicRaycaster = this;
            }
        }
コード例 #2
0
        /// <summary>
        /// Is this the currently focussed Raycaster according to the InputModule
        /// </summary>
        /// <returns></returns>
        public bool IsFocussed()
        {
            TouchUIInputModule inputModule = EventSystem.current.currentInputModule as TouchUIInputModule;

            return(inputModule && inputModule.activeGraphicRaycaster == this);
        }