Beispiel #1
0
    private void DrawConnectionLine(Event e)
    {
        if (m_SelectedInPoint != null && m_SelectedOutPoint == null)
        {
            Handles.DrawBezier(
                m_SelectedInPoint.GetGlobalCenter(),
                e.mousePosition,
                m_SelectedInPoint.GetGlobalCenter() + Vector2.left * 50f,
                e.mousePosition - Vector2.left * 50f,
                Color.white,
                null,
                2f
                );

            GUI.changed = true;
        }

        if (m_SelectedOutPoint != null && m_SelectedInPoint == null)
        {
            Handles.DrawBezier(
                m_SelectedOutPoint.GetGlobalCenter(),
                e.mousePosition,
                m_SelectedOutPoint.GetGlobalCenter() - Vector2.left * 50f,
                e.mousePosition + Vector2.left * 50f,
                Color.white,
                null,
                2f
                );

            GUI.changed = true;
        }
    }
Beispiel #2
0
    public void Draw()
    {
        Handles.DrawBezier(
            m_InPoint.GetGlobalCenter(),
            m_OutPoint.GetGlobalCenter(),
            m_InPoint.GetGlobalCenter() + Vector2.left * 50f,
            m_OutPoint.GetGlobalCenter() - Vector2.left * 50f,
            Color.white,
            null,
            2f
            );

        if (Handles.Button((m_InPoint.GetGlobalCenter() + m_OutPoint.GetGlobalCenter()) * 0.5f, Quaternion.identity, 4, 8, Handles.RectangleHandleCap))
        {
            if (m_OnClickRemoveConnection != null)
            {
                m_OnClickRemoveConnection(this);
            }
        }
    }