private void OnSceneGUI()
    {
        if (!_drawAllConnections)
        {
            return;
        }

        foreach (EditorObjectConnection connection in Target.Registry)
        {
            //Handles.color = connection.MessageColor;
            //Handles.DrawLine(connection.Caller.transform.position, connection.Subject.transform.position);
            DrawConnectionLine.DrawLine(connection.Caller, connection.Subject, connection.MessageColor);
        }
    }
예제 #2
0
    virtual protected void DrawConnectionLines()
    {
        if (ConnectionRegistry.DesignInstance.Registry.Count <= 0)
        {
            return;
        }

        foreach (EditorObjectConnection connection in ConnectionRegistry.DesignInstance.Registry)
        {
            if (connection.Subject == null)
            {
                continue;
            }
            else if (connection.Subject.HighlightHighlight)
            {
                Handles.color = Color.cyan;
                //DrawConnectionHelper(Target.transform.position, connection.Subject.transform.position);
                DrawConnectionLine.DrawLine(Target, connection.Subject, connection.MessageColor);
                continue;
            }

            connection.SetColor();

            Color color = connection.Caller != _target ? connection.MessageColorDark : connection.MessageColor;

            switch (connection.Message)
            {
            case EditorObject.EditorObjectMessage.None:

                DrawConnectionLine.DrawLine(connection.Caller, connection.Subject, color);

                break;

            case EditorObject.EditorObjectMessage.Activate:

                connection.Subject.ActivateHighlight = true;
                DrawConnectionLine.DrawLine(connection.Caller, connection.Subject, color);

                break;

            case EditorObject.EditorObjectMessage.Deactivate:

                connection.Subject.DeactivateHighlight = true;
                DrawConnectionLine.DrawLine(connection.Caller, connection.Subject, color);

                break;

            case EditorObject.EditorObjectMessage.Toggle:

                connection.Subject.ToggleHighlight = true;
                DrawConnectionLine.DrawLine(connection.Caller, connection.Subject, color);

                break;

            case EditorObject.EditorObjectMessage.Enable:

                connection.Subject.ActivateHighlight = true;
                DrawConnectionLine.DrawLine(connection.Caller, connection.Subject, color);

                break;

            case EditorObject.EditorObjectMessage.Disable:

                connection.Subject.DeactivateHighlight = true;
                DrawConnectionLine.DrawLine(connection.Caller, connection.Subject, color);

                break;

            default:

                break;
            }
        }
    }