private void PaintPreSceneGUI(int id)
{
Event current = Event.current;
EventType typeForControl = current.GetTypeForControl(id);
switch (typeForControl)
{
case EventType.MouseDown:
case EventType.MouseDrag:
{
ClothSkinningCoefficient[] coefficients = this.cloth.coefficients;
if ((GUIUtility.hotControl == id) || (((!current.alt && !current.control) && !current.command) && (current.button == 0)))
{
if (typeForControl == EventType.MouseDown)
{
GUIUtility.hotControl = id;
}
int mouseVertex = this.GetMouseVertex(current);
if (mouseVertex != -1)
{
bool flag = false;
if (this.state.PaintMaxDistanceEnabled && (coefficients[mouseVertex].maxDistance != this.state.PaintMaxDistance))
{
coefficients[mouseVertex].maxDistance = this.state.PaintMaxDistance;
flag = true;
}
if (this.state.PaintCollisionSphereDistanceEnabled && (coefficients[mouseVertex].collisionSphereDistance != this.state.PaintCollisionSphereDistance))
{
coefficients[mouseVertex].collisionSphereDistance = this.state.PaintCollisionSphereDistance;
flag = true;
}
if (flag)
{
Undo.RegisterCompleteObjectUndo(base.target, "Paint Cloth");
this.cloth.coefficients = coefficients;
this.SetupSelectionMeshColors();
base.Repaint();
}
}
current.Use();
}
break;
}
default:
if ((typeForControl == EventType.MouseUp) && ((GUIUtility.hotControl == id) && (current.button == 0)))
{
GUIUtility.hotControl = 0;
current.Use();
}
break;
}
}