Esempio n. 1
0
        protected override void HoverEnd(InteractiveHandle target, HoverEndInfo info)
        {
            if (target != m_Handle)
            {
                return;
            }

            SyncColor();
        }
            public void SetHovered(InteractiveHandle handle)
            {
                if (m_ActiveHandle == handle)
                {
                    return;
                }

                m_HoverHandle = handle;
                if (m_State != State.Dragging)
                {
                    if (m_ActiveHandle)
                    {
                        var eventData = new HoverEndInfo();
                        foreach (var behaviour in TakeSnapshot(m_Context.GetHandleBehaviours()))
                        {
                            if (behaviour == null)
                            {
                                continue;
                            }

                            behaviour.DoHoverEnd(m_ActiveHandle, eventData);
                        }
                    }

                    m_ActiveHandle = handle; //If we are dragging, we keep the current active engaged as Hovering and Dragging
                    m_State        = m_ActiveHandle != null ? State.Hovering : State.Idle;

                    if (m_ActiveHandle)
                    {
                        var eventData = new HoverBeginInfo();
                        foreach (var behaviour in TakeSnapshot(m_Context.GetHandleBehaviours()))
                        {
                            if (behaviour == null)
                            {
                                continue;
                            }

                            behaviour.DoHoverBegin(m_ActiveHandle, eventData);
                        }
                    }
                }
            }