/// <inheritdoc />
        void IMixedRealityFocusChangedHandler.OnBeforeFocusChange(FocusEventData eventData)
        {
            if (eventData.NewFocusedObject == gameObject)
            {
                eventData.Pointer.CursorModifier = this;
            }

            if (eventData.OldFocusedObject == gameObject)
            {
                eventData.Pointer.CursorModifier = null;
            }
        }
Esempio n. 2
0
        /// <inheritdoc />
        public void OnFocusExit(FocusEventData eventData)
        {
            if (!eventData.used)
            {
                onFocusExitEvent.Invoke();

                if (markEventsAsUsed)
                {
                    eventData.Use();
                }
            }
        }
Esempio n. 3
0
        /// <summary>
        /// Override to set the cursor animation trigger.
        /// </summary>
        public override void OnFocusChanged(FocusEventData eventData)
        {
            base.OnFocusChanged(eventData);

            if (Pointer.CursorModifier != null)
            {
                if ((Pointer.CursorModifier.CursorParameters != null) && (Pointer.CursorModifier.CursorParameters.Length > 0))
                {
                    OnCursorStateChange(CursorStateEnum.Contextual);

                    for (var i = 0; i < Pointer.CursorModifier.CursorParameters.Length; i++)
                    {
                        SetAnimatorParameter(Pointer.CursorModifier.CursorParameters[i]);
                    }
                }
            }
            else
            {
                OnCursorStateChange(CursorStateEnum.None);
            }
        }
        /// <inheritdoc />
        public virtual void OnBeforeFocusChange(FocusEventData eventData)
        {
            // If we're the new target object,
            // add the pointer to the list of focusers.
            if (eventData.NewFocusedObject == gameObject)
            {
                eventData.Pointer.FocusTarget = this;
                Focusers.Add(eventData.Pointer);
            }
            // If we're the old focused target object,
            // remove the pointer from our list.
            else if (eventData.OldFocusedObject == gameObject)
            {
                Focusers.Remove(eventData.Pointer);

                // If there is no new focused target
                // clear the FocusTarget field from the Pointer.
                if (eventData.NewFocusedObject == null)
                {
                    eventData.Pointer.FocusTarget = null;
                }
            }
        }
Esempio n. 5
0
 /// <inheritdoc />
 public virtual void OnFocusChanged(FocusEventData eventData)
 {
 }
 /// <inheritdoc />
 void IMixedRealityFocusChangedHandler.OnFocusChanged(FocusEventData eventData)
 {
 }
 /// <inheritdoc />
 public virtual void OnFocusExit(FocusEventData eventData)
 {
 }
 /// <inheritdoc />
 public virtual void OnFocusEnter(FocusEventData eventData)
 {
 }