public void MaskFromClip(AvatarMask mask)
{
SerializedProperty property = this.Get("bodyMask");
if ((property != null) && property.isArray)
{
for (AvatarMaskBodyPart part = AvatarMaskBodyPart.Root; part < AvatarMaskBodyPart.LastBodyPart; part += 1)
{
mask.SetHumanoidBodyPartActive(part, property.GetArrayElementAtIndex((int) part).intValue != 0);
}
}
SerializedProperty property2 = this.Get("transformMask");
if ((property2 != null) && property2.isArray)
{
if ((property2.arraySize > 0) && (mask.transformCount != property2.arraySize))
{
mask.transformCount = property2.arraySize;
}
int arraySize = property2.arraySize;
if (arraySize != 0)
{
SerializedProperty arrayElementAtIndex = property2.GetArrayElementAtIndex(0);
for (int i = 0; i < arraySize; i++)
{
SerializedProperty property4 = arrayElementAtIndex.FindPropertyRelative("m_Path");
SerializedProperty property5 = arrayElementAtIndex.FindPropertyRelative("m_Weight");
mask.SetTransformPath(i, property4.stringValue);
mask.SetTransformActive(i, property5.floatValue > 0.5);
arrayElementAtIndex.Next(false);
}
}
}
}