Exemplo n.º 1
0
        /// <summary> Panel to show all Blocked Sequences </summary>
        /// <param name="inlineHelp">Should help be displayed?</param>
        void CurrentlyBlockedPanel(bool inlineHelp)
        {
            Event currentEvent = Event.current;

            foreach (KeyValuePair <Sequence, string> seq in GlobalBlocked)
            {
                EditorGUILayout.BeginHorizontal();
                Rect r         = EditorGUILayout.GetControlRect();
                Rect labelRect = r;
                labelRect.xMin += EditorGUIUtility.labelWidth;
                GUI.Label(labelRect, new GUIContent(seq.Value, seq.Value));
                labelRect.xMax = labelRect.xMin;
                labelRect.xMin = r.xMin;
                Rect meterRect = labelRect;
                meterRect.xMin = meterRect.xMax - meterRect.height;
                if (currentEvent.type == EventType.MouseDown && meterRect.Contains(currentEvent.mousePosition))
                {
                    currentEvent.Use();
                }
                else if (currentEvent.type == EventType.MouseDrag && r.Contains(currentEvent.mousePosition))
                {
                    DragAndDrop.PrepareStartDrag();
                    DragAndDrop.objectReferences = new Object[] { seq.Key };
                    DragAndDrop.StartDrag("Sequence:" + seq.Key.name);
                    currentEvent.Use();
                    weStartedDrag = true;
                }
                else if ((currentEvent.type == EventType.MouseUp || currentEvent.type == EventType.DragExited) && weStartedDrag)
                {
                    weStartedDrag = false;
                    DragAndDrop.PrepareStartDrag();
                }
                EditorGUI.ObjectField(labelRect, seq.Key, typeof(Sequence), false);
                meterRect.xMin  = labelRect.xMax - r.height * 0.75f;
                meterRect.xMax -= labelRect.height * 0.125f;
                if (m_editorUtils.Button("ForceUnblockSequence", EditorStyles.miniButtonRight, GUILayout.ExpandWidth(false)))
                {
                    AmbienceManager.Debug_UnBlockSequence(seq.Key);
                }
                EditorGUILayout.EndHorizontal();
            }
        }