public void OnPointerEnter(PointerEventData eventData) { if (eventData.IsF3dSpacePointer()) { // Gaze has entered this canvas. We'll make it the active one so that canvas-mouse pointer can be used. GCSeriesInputModule inputModule = EventSystem.current.currentInputModule as GCSeriesInputModule; inputModule.activeGraphicRaycaster = this; } }
public void OnPointerExit(PointerEventData eventData) { if (eventData.IsF3dSpacePointer()) { // Gaze has entered this canvas. We'll make it the active one so that canvas-mouse pointer can be used. GCSeriesInputModule inputModule = EventSystem.current.currentInputModule as GCSeriesInputModule; //eventData.pointerEnter if (eventData.pointerPress) { //if(null == eventData.pointerEnter) //{ if (eventData.pointerPress != null) { Button uiButton = eventData.pointerPress.GetComponent <Button>(); if (null != uiButton) { uiButton.OnDeselect(eventData); //uiButton.de } else { Toggle toggle = eventData.pointerPress.GetComponent <Toggle>(); if (toggle != null) { toggle.OnDeselect(eventData); toggle.Select(); } } //} Debug.Log("F3dSpaceRaycaster.OnPointerExit()"); } //.transform.GetComponentInParent } //inputModule.activeGraphicRaycaster = null; } }
/// <summary> /// Is this the currently focussed Raycaster according to the InputModule /// </summary> /// <returns></returns> public bool IsFocussed() { GCSeriesInputModule inputModule = EventSystem.current.currentInputModule as GCSeriesInputModule; return(inputModule && inputModule.activeGraphicRaycaster == this); }