예제 #1
0
        private bool ProcessNode(NodeEntity entity)
        {
            if (!entity.m_Rect.Contains(Event.current.mousePosition))
            {
                return(false);
            }
            switch (Event.current.type)
            {
            case EventType.MouseDown:
                if (Event.current.button == 0)
                {
                    entity.OnMouseLeftDown(Event.current);
                }
                else
                {
                    entity.OnMouseRightDown(Event.current);
                }
                break;

            case EventType.MouseUp:
                if (Event.current.button == 0)
                {
                    entity.OnMouseLeftUp(Event.current);
                }
                else
                {
                    entity.OnMouseRightUp(Event.current);
                }
                break;

            case EventType.MouseDrag:
                if (Event.current.button == 0)
                {
                    entity.OnMouseLeftDrag(Event.current);
                }
                else
                {
                    entity.OnMouseRightDrag(Event.current);
                }
                break;
            }
            return(true);
        }
예제 #2
0
 private void DrawNode(NodeEntity entity)
 {
     GUI.Box(entity.m_Rect, entity.m_Name, entity.m_Style);
 }