private SetHumanoidBodyPartActive ( AvatarMaskBodyPart index, bool value ) : void | ||
index | AvatarMaskBodyPart | |
value | bool | |
Результат | void |
public void ConfigureMaskFromClip(ref AvatarMask mask) { mask.transformCount = this.m_TransformMask.Length; for (int i = 0; i < mask.transformCount; i++) { mask.SetTransformPath(i, this.m_TransformMask[i].path); mask.SetTransformActive(i, this.m_TransformMask[i].weight > 0f); } for (int j = 0; j < this.m_BodyMask.Length; j++) { mask.SetHumanoidBodyPartActive((AvatarMaskBodyPart) j, this.m_BodyMask[j] != 0); } }
public void MaskFromClip(AvatarMask mask) { SerializedProperty serializedProperty1 = this.Get("bodyMask"); if (serializedProperty1 != null && serializedProperty1.isArray) { for (AvatarMaskBodyPart index = AvatarMaskBodyPart.Root; index < AvatarMaskBodyPart.LastBodyPart; ++index) mask.SetHumanoidBodyPartActive(index, serializedProperty1.GetArrayElementAtIndex((int) index).intValue != 0); } SerializedProperty serializedProperty2 = this.Get("transformMask"); if (serializedProperty2 == null || !serializedProperty2.isArray) return; if (serializedProperty2.arraySize > 0 && mask.transformCount != serializedProperty2.arraySize) mask.transformCount = serializedProperty2.arraySize; int arraySize = serializedProperty2.arraySize; for (int index = 0; index < arraySize; ++index) { SerializedProperty propertyRelative1 = serializedProperty2.GetArrayElementAtIndex(index).FindPropertyRelative("m_Path"); SerializedProperty propertyRelative2 = serializedProperty2.GetArrayElementAtIndex(index).FindPropertyRelative("m_Weight"); mask.SetTransformPath(index, propertyRelative1.stringValue); mask.SetTransformActive(index, (double) propertyRelative2.floatValue > 0.5); } }
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); } } } }
public void MaskFromClip(AvatarMask mask) { SerializedProperty property = this.Get("bodyMask"); if ((property != null) && property.isArray) { for (int i = 0; i < mask.humanoidBodyPartCount; i++) { mask.SetHumanoidBodyPartActive(i, property.GetArrayElementAtIndex(i).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; for (int j = 0; j < arraySize; j++) { SerializedProperty property3 = property2.GetArrayElementAtIndex(j).FindPropertyRelative("m_Path"); SerializedProperty property4 = property2.GetArrayElementAtIndex(j).FindPropertyRelative("m_Weight"); mask.SetTransformPath(j, property3.stringValue); mask.SetTransformActive(j, property4.floatValue > 0.5); } } }