This commit is contained in:
陈思海 2025-07-29 15:19:40 +08:00
parent 0499cf9f4d
commit 208bab1c7a

View File

@ -342,12 +342,19 @@ internal class UXButtonEditor : Editor
float spacing = 2f; float spacing = 2f;
float y = position.y; float y = position.y;
Rect targetRect = new Rect(position.x, y, position.width, lineHeight);
EditorGUI.PropertyField(targetRect, targetGraphic);
y += lineHeight + spacing;
var currentTransition = GetTransition(transition); var currentTransition = GetTransition(transition);
switch (currentTransition)
{
case Selectable.Transition.ColorTint:
case Selectable.Transition.SpriteSwap:
Rect targetRect = new Rect(position.x, y, position.width, lineHeight);
EditorGUI.PropertyField(targetRect, targetGraphic);
y += lineHeight + spacing;
break;
}
Rect transitionRect = new Rect(position.x, y, position.width, lineHeight); Rect transitionRect = new Rect(position.x, y, position.width, lineHeight);
EditorGUI.PropertyField(transitionRect, transition); EditorGUI.PropertyField(transitionRect, transition);
y += lineHeight + spacing; y += lineHeight + spacing;
@ -418,14 +425,19 @@ internal class UXButtonEditor : Editor
targetGraphic.objectReferenceValue = graphic; targetGraphic.objectReferenceValue = graphic;
} }
EditorGUILayout.PropertyField(targetGraphic);
SerializedProperty transition = m_TransitionData.FindPropertyRelative("transition"); SerializedProperty transition = m_TransitionData.FindPropertyRelative("transition");
EditorGUILayout.PropertyField(transition);
var currentTransition = GetTransition(transition); var currentTransition = GetTransition(transition);
switch (currentTransition)
{
case Selectable.Transition.ColorTint:
case Selectable.Transition.SpriteSwap:
EditorGUILayout.PropertyField(targetGraphic);
break;
}
EditorGUILayout.PropertyField(transition);
var animator = graphic != null ? graphic.GetComponent<Animator>() : null; var animator = graphic != null ? graphic.GetComponent<Animator>() : null;
switch (currentTransition) switch (currentTransition)
{ {