private void OnRemoveParameter(int index)
{
if (!this.m_Host.liveLink && (this.m_ParameterList.list.Count > 0))
{
Element element = this.m_ParameterList.list[index] as Element;
List<UnityEngine.Object> list = Enumerable.ToList<UnityEngine.Object>(this.m_Host.animatorController.CollectObjectsUsingParameter(element.name));
bool flag = false;
if (list.Count > 0)
{
string title = "Delete parameter " + element.name + "?";
string message = "It is used by : \n";
foreach (UnityEngine.Object obj2 in list)
{
AnimatorTransitionBase base2 = obj2 as AnimatorTransitionBase;
if ((base2 != null) && (base2.destinationState != null))
{
message = message + "Transition to " + base2.destinationState.name + "\n";
}
else if ((base2 != null) && (base2.destinationStateMachine != null))
{
message = message + "Transition to " + base2.destinationStateMachine.name + "\n";
}
else
{
message = message + obj2.name + "\n";
}
}
if (EditorUtility.DisplayDialog(title, message, "Delete", "Cancel"))
{
flag = true;
}
}
else
{
flag = true;
}
if (flag)
{
this.ResetTextFields();
list.Add(this.m_Host.animatorController);
Undo.RegisterCompleteObjectUndo(list.ToArray(), "Parameter removed");
this.m_Host.animatorController.RemoveParameter(element.m_Parameter);
this.RebuildList();
this.m_ParameterList.GrabKeyboardFocus();
}
}
}