コード例 #1
0
 protected virtual void OnUnhighlighted(HighlighterEventArgs e)
 {
     if (m_unhighlighted != null)
     {
         m_unhighlighted(this, e);
     }
 }
コード例 #2
0
 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);
 }
コード例 #4
0
 protected override void OnUnhighlighted(HighlighterEventArgs e)
 {
     base.OnUnhighlighted(e);
     ToggleMark(false);
 }
コード例 #5
0
 protected override void OnHighlighted(HighlighterEventArgs e)
 {
     base.OnHighlighted(e);
     ToggleMark(true);
 }
コード例 #6
0
        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;
            }
        }