protected void MuscleGroupGUI() { bool flag = false; this.HeaderGUI("Preview", "Muscle Group Preview"); GUILayout.BeginVertical(AvatarMuscleEditor.styles.box, new GUILayoutOption[0]); Rect rect1 = GUILayoutUtility.GetRect(10f, 16f); Rect settingsRect1 = AvatarMuscleEditor.GetSettingsRect(rect1); if (GUI.Button(AvatarMuscleEditor.GetPreviewRect(rect1), "Reset All", EditorStyles.miniButton)) { for (int index = 0; index < this.m_MuscleMasterValue.Length; ++index) { this.m_MuscleMasterValue[index] = 0.0f; } for (int index = 0; index < this.m_MuscleValue.Length; ++index) { this.m_MuscleValue[index] = 0.0f; } flag = true; } GUI.Label(settingsRect1, "Reset All Preview Values", EditorStyles.label); for (int index1 = 0; index1 < this.m_MasterMuscle.Length; ++index1) { Rect rect2 = GUILayoutUtility.GetRect(10f, 16f); Rect settingsRect2 = AvatarMuscleEditor.GetSettingsRect(rect2); float num = this.m_MuscleMasterValue[index1]; this.m_MuscleMasterValue[index1] = AvatarMuscleEditor.PreviewSlider(rect2, this.m_MuscleMasterValue[index1]); if ((double)this.m_MuscleMasterValue[index1] != (double)num) { Undo.RegisterCompleteObjectUndo((UnityEngine.Object) this, "Muscle preview"); for (int index2 = 0; index2 < this.m_MasterMuscle[index1].Length; ++index2) { if (this.m_MasterMuscle[index1][index2] != -1) { this.m_MuscleValue[this.m_MasterMuscle[index1][index2]] = this.m_MuscleMasterValue[index1]; } } } flag = ((flag ? 1 : 0) | ((double)this.m_MuscleMasterValue[index1] == (double)num ? 0 : ((UnityEngine.Object) this.gameObject != (UnityEngine.Object)null ? 1 : 0))) != 0; GUI.Label(settingsRect2, AvatarMuscleEditor.styles.muscleTypeGroup[index1], EditorStyles.label); } GUILayout.EndVertical(); if (!flag) { return; } this.WritePose(); }
protected void MuscleGroupGUI() { bool flag = false; this.HeaderGUI("Preview", "Muscle Group Preview"); GUILayout.BeginVertical(AvatarMuscleEditor.styles.box, new GUILayoutOption[0]); Rect rect = GUILayoutUtility.GetRect(10f, 16f); Rect settingsRect = AvatarMuscleEditor.GetSettingsRect(rect); Rect previewRect = AvatarMuscleEditor.GetPreviewRect(rect); if (GUI.Button(previewRect, "Reset All", EditorStyles.miniButton)) { for (int i = 0; i < this.m_MuscleMasterValue.Length; i++) { this.m_MuscleMasterValue[i] = 0f; } for (int j = 0; j < this.m_MuscleValue.Length; j++) { this.m_MuscleValue[j] = 0f; } flag = true; } GUI.Label(settingsRect, "Reset All Preview Values", EditorStyles.label); for (int k = 0; k < this.m_MasterMuscle.Length; k++) { Rect rect2 = GUILayoutUtility.GetRect(10f, 16f); Rect settingsRect2 = AvatarMuscleEditor.GetSettingsRect(rect2); float num = this.m_MuscleMasterValue[k]; this.m_MuscleMasterValue[k] = AvatarMuscleEditor.PreviewSlider(rect2, this.m_MuscleMasterValue[k]); if (this.m_MuscleMasterValue[k] != num) { Undo.RegisterCompleteObjectUndo(this, "Muscle preview"); for (int l = 0; l < this.m_MasterMuscle[k].Length; l++) { if (this.m_MasterMuscle[k][l] != -1) { this.m_MuscleValue[this.m_MasterMuscle[k][l]] = this.m_MuscleMasterValue[k]; } } } flag |= (this.m_MuscleMasterValue[k] != num && base.gameObject != null); GUI.Label(settingsRect2, AvatarMuscleEditor.styles.muscleTypeGroup[k], EditorStyles.label); } GUILayout.EndVertical(); if (flag) { this.WritePose(); } }
protected void MuscleGUI() { bool flag1 = false; this.HeaderGUI("Preview", "Per-Muscle Settings"); GUILayout.BeginVertical(AvatarMuscleEditor.styles.box, new GUILayoutOption[0]); for (int index1 = 0; index1 < this.m_MuscleBodyGroupToggle.Length; ++index1) { Rect settingsRect = AvatarMuscleEditor.GetSettingsRect(GUILayoutUtility.GetRect(10f, 16f)); this.m_MuscleBodyGroupToggle[index1] = GUI.Toggle(settingsRect, this.m_MuscleBodyGroupToggle[index1], AvatarMuscleEditor.styles.muscleBodyGroup[index1], EditorStyles.foldout); if (this.m_MuscleBodyGroupToggle[index1]) { for (int index2 = 0; index2 < this.m_Muscles[index1].Length; ++index2) { int muscleId = this.m_Muscles[index1][index2]; if (muscleId != -1 && this.m_MuscleMin[muscleId] != null && this.m_MuscleMax[muscleId] != null) { bool flag2 = this.m_MuscleToggle[muscleId]; Rect rect = GUILayoutUtility.GetRect(10f, !flag2 ? 16f : 32f); settingsRect = AvatarMuscleEditor.GetSettingsRect(rect); settingsRect.xMin += 15f; settingsRect.height = 16f; this.m_MuscleToggle[muscleId] = GUI.Toggle(settingsRect, this.m_MuscleToggle[muscleId], this.m_MuscleName[muscleId], EditorStyles.foldout); float num = AvatarMuscleEditor.PreviewSlider(rect, this.m_MuscleValue[muscleId]); if ((double)this.m_MuscleValue[muscleId] != (double)num) { Undo.RegisterCompleteObjectUndo((UnityEngine.Object) this, "Muscle preview"); this.m_FocusedMuscle = muscleId; this.m_MuscleValue[muscleId] = num; flag1 |= (UnityEngine.Object) this.gameObject != (UnityEngine.Object)null; } if (flag2) { bool flag3 = false; settingsRect.xMin += 15f; settingsRect.y += 16f; Rect position1 = settingsRect; if ((double)settingsRect.width > 160.0) { Rect position2 = settingsRect; position2.width = 38f; EditorGUI.BeginChangeCheck(); this.m_MuscleMinEdit[muscleId] = EditorGUI.FloatField(position2, this.m_MuscleMinEdit[muscleId]); bool flag4 = flag3 | EditorGUI.EndChangeCheck(); position2.x = settingsRect.xMax - 38f; EditorGUI.BeginChangeCheck(); this.m_MuscleMaxEdit[muscleId] = EditorGUI.FloatField(position2, this.m_MuscleMaxEdit[muscleId]); flag3 = flag4 | EditorGUI.EndChangeCheck(); position1.xMin += 43f; position1.xMax -= 43f; } EditorGUI.BeginChangeCheck(); EditorGUI.MinMaxSlider(position1, ref this.m_MuscleMinEdit[muscleId], ref this.m_MuscleMaxEdit[muscleId], -180f, 180f); if (flag3 | EditorGUI.EndChangeCheck()) { this.m_MuscleMinEdit[muscleId] = Mathf.Clamp(this.m_MuscleMinEdit[muscleId], -180f, 0.0f); this.m_MuscleMaxEdit[muscleId] = Mathf.Clamp(this.m_MuscleMaxEdit[muscleId], 0.0f, 180f); flag1 |= this.UpdateMuscle(muscleId, this.m_MuscleMinEdit[muscleId], this.m_MuscleMaxEdit[muscleId]); } } } } } } GUILayout.EndVertical(); if (!flag1) { return; } this.WritePose(); }
protected void MuscleGUI() { bool flag = false; this.HeaderGUI("Preview", "Per-Muscle Settings"); GUILayout.BeginVertical(AvatarMuscleEditor.styles.box, new GUILayoutOption[0]); for (int i = 0; i < this.m_MuscleBodyGroupToggle.Length; i++) { Rect rect = GUILayoutUtility.GetRect(10f, 16f); Rect settingsRect = AvatarMuscleEditor.GetSettingsRect(rect); this.m_MuscleBodyGroupToggle[i] = GUI.Toggle(settingsRect, this.m_MuscleBodyGroupToggle[i], AvatarMuscleEditor.styles.muscleBodyGroup[i], EditorStyles.foldout); if (this.m_MuscleBodyGroupToggle[i]) { for (int j = 0; j < this.m_Muscles[i].Length; j++) { int num = this.m_Muscles[i][j]; if (num != -1 && this.m_MuscleMin[num] != null && this.m_MuscleMax[num] != null) { bool flag2 = this.m_MuscleToggle[num]; rect = GUILayoutUtility.GetRect(10f, (!flag2) ? 16f : 32f); settingsRect = AvatarMuscleEditor.GetSettingsRect(rect); settingsRect.xMin += 15f; settingsRect.height = 16f; this.m_MuscleToggle[num] = GUI.Toggle(settingsRect, this.m_MuscleToggle[num], this.m_MuscleName[num], EditorStyles.foldout); float num2 = AvatarMuscleEditor.PreviewSlider(rect, this.m_MuscleValue[num]); if (this.m_MuscleValue[num] != num2) { Undo.RegisterCompleteObjectUndo(this, "Muscle preview"); this.m_FocusedMuscle = num; this.m_MuscleValue[num] = num2; flag |= (base.gameObject != null); } if (flag2) { bool flag3 = false; settingsRect.xMin += 15f; settingsRect.y += 16f; Rect position = settingsRect; if (settingsRect.width > 160f) { Rect position2 = settingsRect; position2.width = 38f; EditorGUI.BeginChangeCheck(); this.m_MuscleMinEdit[num] = EditorGUI.FloatField(position2, this.m_MuscleMinEdit[num]); flag3 |= EditorGUI.EndChangeCheck(); position2.x = settingsRect.xMax - 38f; EditorGUI.BeginChangeCheck(); this.m_MuscleMaxEdit[num] = EditorGUI.FloatField(position2, this.m_MuscleMaxEdit[num]); flag3 |= EditorGUI.EndChangeCheck(); position.xMin += 43f; position.xMax -= 43f; } EditorGUI.BeginChangeCheck(); EditorGUI.MinMaxSlider(position, ref this.m_MuscleMinEdit[num], ref this.m_MuscleMaxEdit[num], -180f, 180f); flag3 |= EditorGUI.EndChangeCheck(); if (flag3) { this.m_MuscleMinEdit[num] = Mathf.Clamp(this.m_MuscleMinEdit[num], -180f, 0f); this.m_MuscleMaxEdit[num] = Mathf.Clamp(this.m_MuscleMaxEdit[num], 0f, 180f); flag |= this.UpdateMuscle(num, this.m_MuscleMinEdit[num], this.m_MuscleMaxEdit[num]); } } } } } } GUILayout.EndVertical(); if (flag) { this.WritePose(); } }