private static GetPreviewRect ( |
||
wholeWidthRect | ||
Результат |
private static float PreviewSlider(Rect position, float val) { val = GUI.HorizontalSlider(AvatarMuscleEditor.GetPreviewRect(position), val, -1f, 1f); if ((double)val > -0.100000001490116 && (double)val < 0.100000001490116) { val = 0.0f; } return(val); }
private static float PreviewSlider(Rect position, float val) { val = GUI.HorizontalSlider(AvatarMuscleEditor.GetPreviewRect(position), val, -1f, 1f); if (val > -0.1f && val < 0.1f) { val = 0f; } return(val); }
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(); } }