You've already forked ParticleEffectForUGUI
mirror of
https://github.com/mob-sakai/ParticleEffectForUGUI.git
synced 2026-05-14 20:20:06 +00:00
refactor: modify the value when the field is changed
This commit is contained in:
@@ -250,20 +250,27 @@ 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, x.floatValue);
|
||||
z.floatValue = Mathf.Max(0.001f, x.floatValue);
|
||||
}
|
||||
}
|
||||
|
||||
if (x.floatValue < 0.001f) x.floatValue = 0.001f;
|
||||
if (y.floatValue < 0.001f) y.floatValue = 0.001f;
|
||||
if (z.floatValue < 0.001f) z.floatValue = 0.001f;
|
||||
|
||||
EditorGUI.BeginChangeCheck();
|
||||
showXyz = GUILayout.Toggle(showXyz, s_Content3D, EditorStyles.miniButton, GUILayout.Width(30));
|
||||
if (EditorGUI.EndChangeCheck() && !showXyz)
|
||||
|
||||
Reference in New Issue
Block a user