Exemplo n.º 1
0
 private void ResolveState()
 {
     _isInteractable = PawnControl.IsInteractable;
     _lastHoverEvent = HoverableProvider.LastHoverableEvent;
     _pawnState      = PawnControl.PawnState;
     _pawnBehaviour  = PawnControl.PawnBehaviour;
 }
Exemplo n.º 2
0
 public void HandleHoverableEvent(EHoverableEvent hover)
 {
     _lastHoverEvent = hover;
     AddData(hover);
     _onHover.Invoke(this);
     Render();
 }
Exemplo n.º 3
0
        /// <summary>
        /// Converts to standard visual state from hoverable event
        /// </summary>
        /// <param name="evt"></param>
        /// <returns></returns>
        public static bool TryFromEHoverableEvent(EHoverableEvent evt, out EUiVisualState state)
        {
            switch (evt)
            {
            case EHoverableEvent.Absent:
                state = EUiVisualState.Neutral;
                return(true);

            case EHoverableEvent.Down:
                state = EUiVisualState.Down;
                return(true);

            case EHoverableEvent.Hovering:
                state = EUiVisualState.Hover;
                return(true);
            }

            state = default;
            return(false);
        }
Exemplo n.º 4
0
        /// <summary>
        /// Handle hover events
        /// </summary>
        /// <param name="hover"></param>
        public void HandleHoverableEvent(EHoverableEvent hover)
        {
#if HEXDB
            if (Log != null)
            {
                Log.Invoke($"${gameObject.name}:{nameof(ToggleUIViewHoverColor)} received hover event {hover}");
            }
#endif
            if (hover != EHoverableEvent.Down) // toggle doesn't react to down
            {
                _isHovering = hover == EHoverableEvent.Hovering;

                if (!IsStarted)
                {
                    ResolveColorReferences();
                }
                else
                {
                    Render();
                }
            }
        }
Exemplo n.º 5
0
 /// <summary>
 /// Handle visual changes that occur when hover events are fired
 /// </summary>
 /// <param name="interactionState"></param>
 protected abstract void HandleHoverableEvent(EHoverableEvent hover);
 protected override void HandleHoverableEvent(EHoverableEvent hover)
 {
     _lastHoverEvent = hover;
     _isMaterialChangedSinceLastFrame = true;
 }
Exemplo n.º 7
0
 /// <summary>
 /// Handle visual changes that occur when hover events are fired
 /// </summary>
 /// <param name="interactionState"></param>
 public void HandleHoverableEvent(EHoverableEvent hover)
 {
     _hoverState = hover;
     Render();
 }
Exemplo n.º 8
0
 private void HandleHoverableEvent(EHoverableEvent evt)
 {
     _lastHoverableEvent = evt;
 }