Merge pull request #150 from Tointer/fix_multiselecting_bug

fix: Multiselecting sets all scales to the same value
pull/169/head
mob-sakai 2021-02-19 09:57:37 +09:00 committed by GitHub
commit d775e805fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 5 deletions

View File

@ -250,19 +250,26 @@ namespace Coffee.UIExtensions
EditorGUILayout.BeginHorizontal();
if (showXyz)
{
EditorGUI.BeginChangeCheck();
EditorGUILayout.PropertyField(sp);
if (EditorGUI.EndChangeCheck())
{
x.floatValue = Mathf.Max(0.001f, x.floatValue);
y.floatValue = Mathf.Max(0.001f, y.floatValue);
z.floatValue = Mathf.Max(0.001f, z.floatValue);
}
}
else
{
EditorGUI.BeginChangeCheck();
EditorGUILayout.PropertyField(x, s_ContentScale);
if (EditorGUI.EndChangeCheck())
z.floatValue = y.floatValue = x.floatValue;
}
{
x.floatValue = Mathf.Max(0.001f, x.floatValue);
y.floatValue = Mathf.Max(0.001f, y.floatValue);
z.floatValue = Mathf.Max(0.001f, z.floatValue);
y.floatValue = Mathf.Max(0.001f, x.floatValue);
z.floatValue = Mathf.Max(0.001f, x.floatValue);
}
}
EditorGUI.BeginChangeCheck();
showXyz = GUILayout.Toggle(showXyz, s_Content3D, EditorStyles.miniButton, GUILayout.Width(30));