public void HandleDragging(Rect totalRect, AudioMixerGroupController group, AudioMixerController controller)
{
if (!this.isDragging)
{
return;
}
Event current = Event.current;
EventType typeForControl = current.GetTypeForControl(this.m_DragControlID);
switch (typeForControl)
{
case EventType.MouseUp:
current.Use();
if (this.m_MovingSrcIndex == -1)
{
break;
}
if (this.m_MovingDstIndex != -1 && this.m_MovingEffectAllowed)
{
List <AudioMixerEffectController> list = ((IEnumerable <AudioMixerEffectController>)group.effects).ToList <AudioMixerEffectController>();
if (AudioMixerController.MoveEffect(ref list, this.m_MovingSrcIndex, ref list, this.m_MovingDstIndex))
{
group.effects = list.ToArray();
}
}
this.m_MovingSrcIndex = -1;
this.m_MovingDstIndex = -1;
controller.m_HighlightEffectIndex = -1;
if (GUIUtility.hotControl == this.m_DragControlID)
{
GUIUtility.hotControl = 0;
}
EditorGUIUtility.SetWantsMouseJumping(0);
AudioMixerUtility.RepaintAudioMixerAndInspectors();
GUIUtility.ExitGUI();
break;
case EventType.MouseDrag:
this.m_MovingPos = current.mousePosition.y;
current.Use();
break;
default:
if (typeForControl != EventType.Repaint || (double)this.m_DragHighlightPos <= 0.0)
{
break;
}
float width = totalRect.width;
Color color1 = !this.m_MovingEffectAllowed ? this.kMoveColorLoDisallowed : this.kMoveColorLoAllowed;
Color color2 = !this.m_MovingEffectAllowed ? this.kMoveColorHiDisallowed : this.kMoveColorHiAllowed;
Color color3 = !this.m_MovingEffectAllowed ? this.kMoveColorBorderDisallowed : this.kMoveColorBorderAllowed;
AudioMixerDrawUtils.DrawGradientRect(new Rect(this.m_MovingRect.x, this.m_DragHighlightPos - 15f, width, 15f), color1, color2);
AudioMixerDrawUtils.DrawGradientRect(new Rect(this.m_MovingRect.x, this.m_DragHighlightPos, width, 15f), color2, color1);
AudioMixerDrawUtils.DrawGradientRect(new Rect(this.m_MovingRect.x, this.m_DragHighlightPos - this.m_DragHighlightHeight / 2f, width, this.m_DragHighlightHeight), color3, color3);
break;
}
}