Exemple #1
0
        private static void NewEventArea(InAudioEventNode 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 action"))
            {
                ShowCreationContext(audioevent);
            }

            var dragging = DragAndDrop.objectReferences;

            OnDragging.OnDraggingObject(dragging, lastArea,
                                        objects => AudioEventWorker.CanDropObjects(audioevent, dragging),
                                        objects => AudioEventWorker.OnDrop(audioevent, dragging));

            GUI.skin.label.alignment = defaultAlignment;
        }
 protected override bool CanDropObjects(InAudioEventNode audioEvent, Object[] objects)
 {
     return(AudioEventWorker.CanDropObjects(audioEvent, objects));
 }