protected virtual void OnUnhighlighted(HighlighterEventArgs e)
 {
     if (m_unhighlighted != null)
     {
         m_unhighlighted(this, e);
     }
 }
 protected virtual void OnHighlighted(HighlighterEventArgs e)
 {
     if (e.m_duration > 0f)
     {
         Invoke("OnUnhighlighted", e.m_duration);
     }
     if (m_highlighted != null)
     {
         m_highlighted(this, e);
     }
 }
示例#3
0
 protected override void OnUnhighlighted(HighlighterEventArgs e)
 {
     base.OnUnhighlighted(e);
     m_highlightCopy.SetActive(false);
 }
 protected override void OnUnhighlighted(HighlighterEventArgs e)
 {
     base.OnUnhighlighted(e);
     ToggleMark(false);
 }
 protected override void OnHighlighted(HighlighterEventArgs e)
 {
     base.OnHighlighted(e);
     ToggleMark(true);
 }
        private void InitEvent()
        {
            switch (m_highlightType)
            {
            case EnumHighlightType.Hovered:
                m_interactiveObject.HoveredIn += (sender, e) =>
                {
                    OnHighlighted();
                };
                m_interactiveObject.HoveredOut += (sender, e) =>
                {
                    OnUnhighlighted();
                };
                break;

            case EnumHighlightType.LeftButtonPressed:
                m_interactiveObject.LeftButtonPressed += (sender, e) =>
                {
                    OnHighlighted();
                };
                m_interactiveObject.LeftButtonReleased += (sender, e) =>
                {
                    OnUnhighlighted();
                };
                break;

            case EnumHighlightType.LeftButtonClicked:
                m_interactiveObject.LeftButtonReleased += (sender, e) =>
                {
                    var args = new HighlighterEventArgs();
                    args.m_duration = 0.3f;
                    OnHighlighted(args);
                };
                break;

            case EnumHighlightType.RightButtonPressed:
                m_interactiveObject.RightButtonPressed += (sender, e) =>
                {
                    OnHighlighted();
                };
                m_interactiveObject.RightButtonReleased += (sender, e) =>
                {
                    OnUnhighlighted();
                };
                break;

            case EnumHighlightType.RightButtonClicked:
                m_interactiveObject.RightButtonReleased += (sender, e) =>
                {
                    var args = new HighlighterEventArgs();
                    args.m_duration = 0.3f;
                    OnHighlighted(args);
                };
                break;

            case EnumHighlightType.DraggedOnPlane:
                m_interactiveObject.HoveredIn += (sender, e) =>
                {
                    OnHighlighted();
                };
                m_interactiveObject.LeftButtonPressed += (sender, e) =>
                {
                    OnHighlighted();
                };
                m_interactiveObject.HoveredOut += (sender, e) =>
                {
                    if (!m_interactiveObject.IsLeftButtonSelected)
                    {
                        OnUnhighlighted();
                    }
                };
                m_interactiveObject.LeftButtonReleased += (sender, e) =>
                {
                    OnUnhighlighted();
                };
                break;
            }
        }