Example #1
0
    private static void NewEventArea(AudioEvent audioevent)
    {
        var defaultAlignment = GUI.skin.label.alignment;

        EditorGUILayout.BeginHorizontal();

        GUI.skin.label.alignment = TextAnchor.MiddleLeft;

        EditorGUILayout.LabelField("");

        EditorGUILayout.EndHorizontal();
        Rect lastArea = GUILayoutUtility.GetLastRect();

        lastArea.height *= 1.5f;

        if (GUI.Button(lastArea, "Click or drag here to add event"))
        {
            ShowCreationContext(audioevent);
        }
        if (Event.current.type != EventType.Repaint)
        {
            var dragging = DragAndDrop.objectReferences;
            OnDragging.OnDraggingObject(dragging, lastArea,
                                        objects => AudioEventWorker.CanDropObjects(audioevent, dragging),
                                        objects => AudioEventWorker.OnDrop(audioevent, dragging));
        }
        GUI.skin.label.alignment = defaultAlignment;
    }
Example #2
0
 protected override bool CanDropObjects(InAudioEventNode audioEvent, Object[] objects)
 {
     return(AudioEventWorker.CanDropObjects(audioEvent, objects));
 }