Skip to content

Commit 2cca822

Browse files
committed
fix: indicate in the inspector using tooltips and asterisks that Rotation and Keep Aspect Ratio are shared properties
1 parent 90ab16c commit 2cca822

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

Packages/src/Editor/UIEffectPropertyEditor.cs

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@ public abstract class UIEffectPropertyEditor : Editor
101101
private SerializedProperty _detailTexSpeed;
102102

103103
private SerializedProperty _flip;
104+
private static GUIContent s_RotationLabel = new GUIContent("* Rotation");
105+
private static GUIContent s_KeepAspectRatioLabel = new GUIContent("* Keep Aspect Ratio");
104106

105107
protected virtual void OnEnable()
106108
{
@@ -134,6 +136,9 @@ protected virtual void OnEnable()
134136
_transitionPatternReverse = serializedObject.FindProperty("m_TransitionPatternReverse");
135137
_transitionAutoPlaySpeed = serializedObject.FindProperty("m_TransitionAutoPlaySpeed");
136138

139+
s_RotationLabel.tooltip = _transitionRotation.tooltip;
140+
s_KeepAspectRatioLabel.tooltip = _transitionKeepAspectRatio.tooltip;
141+
137142
_targetMode = serializedObject.FindProperty("m_TargetMode");
138143
_targetColor = serializedObject.FindProperty("m_TargetColor");
139144
_targetRange = serializedObject.FindProperty("m_TargetRange");
@@ -251,9 +256,8 @@ public void DrawProperties()
251256
EditorApplication.QueuePlayerLoopUpdate();
252257
}
253258

254-
EditorGUILayout.PropertyField(_transitionRotation, EditorGUIUtility.TrTempContent("Rotation"));
255-
EditorGUILayout.PropertyField(_transitionKeepAspectRatio,
256-
EditorGUIUtility.TrTempContent("Keep Aspect Ratio"));
259+
EditorGUILayout.PropertyField(_transitionRotation, s_RotationLabel);
260+
EditorGUILayout.PropertyField(_transitionKeepAspectRatio, s_KeepAspectRatioLabel);
257261
EditorGUILayout.PropertyField(_transitionReverse, EditorGUIUtility.TrTempContent("Reverse"));
258262
EditorGUI.indentLevel--;
259263

@@ -387,8 +391,7 @@ public void DrawProperties()
387391
EditorGUILayout.PropertyField(_gradationRotation);
388392
}
389393

390-
EditorGUILayout.PropertyField(_transitionKeepAspectRatio,
391-
EditorGUIUtility.TrTempContent("Keep Aspect Ratio"));
394+
EditorGUILayout.PropertyField(_transitionKeepAspectRatio, s_KeepAspectRatioLabel);
392395
EditorGUI.indentLevel--;
393396
}
394397

@@ -442,9 +445,8 @@ public void DrawProperties()
442445
EditorApplication.QueuePlayerLoopUpdate();
443446
}
444447

445-
EditorGUILayout.PropertyField(_transitionRotation, EditorGUIUtility.TrTempContent("Rotation"));
446-
EditorGUILayout.PropertyField(_transitionKeepAspectRatio,
447-
EditorGUIUtility.TrTempContent("Keep Aspect Ratio"));
448+
EditorGUILayout.PropertyField(_transitionRotation, s_RotationLabel);
449+
EditorGUILayout.PropertyField(_transitionKeepAspectRatio, s_KeepAspectRatioLabel);
448450
EditorGUI.indentLevel--;
449451
EditorGUI.indentLevel--;
450452
}

Packages/src/Runtime/UIEffect.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,14 @@ public class UIEffect : UIEffectBase
6969
[SerializeField]
7070
protected Vector2 m_TransitionTexSpeed = new Vector2(0, 0);
7171

72+
[Tooltip("Effect rotation (0–360).\n" +
73+
"NOTE: This property is shared between `Transition Filter` and `Detail Filter`.")]
7274
[SerializeField]
7375
[Range(0, 360)]
7476
private float m_TransitionRotation = 0;
7577

78+
[Tooltip("The effect maintains its aspect ratio.\n" +
79+
"NOTE: This property is shared between `Transition Filter`, `Gradation Mode`, and `Detail Filter`.")]
7680
[SerializeField]
7781
protected bool m_TransitionKeepAspectRatio = true;
7882

0 commit comments

Comments
 (0)