修复stylefield显示为红色字段的问题。

This commit is contained in:
2026-07-06 17:58:42 +08:00
parent b3db3b2b06
commit a6047062c6
15 changed files with 234 additions and 238 deletions
+2 -2
View File
@@ -184,11 +184,11 @@ namespace XericUI.OverrideUI
t.onClick = d.onClick;
});
[UnityEditor.MenuItem("CONTEXT/Button/Replace To/Unity Button", true)]
[UnityEditor.MenuItem("CONTEXT/Button/Replace To/Unity Button (Native)", true)]
private static bool ValidateReplaceToUnity(UnityEditor.MenuCommand command)
=> command.context is XericButton;
[UnityEditor.MenuItem("CONTEXT/Button/Replace To/Unity Button", false, 100)]
[UnityEditor.MenuItem("CONTEXT/Button/Replace To/Unity Button (Native)", false, 100)]
private static void ReplaceToUnity(UnityEditor.MenuCommand command)
=> command.ReplaceCommandContext<XericButton, Button,
(Graphic targetGraphic, ButtonClickedEvent onClick)>(
+2 -2
View File
@@ -41,11 +41,11 @@ namespace XericUI.OverrideUI
t.sprite = d;
});
[UnityEditor.MenuItem("CONTEXT/Image/Replace To/Unity Image", true)]
[UnityEditor.MenuItem("CONTEXT/Image/Replace To/Unity Image (Native)", true)]
private static bool ValidateReplaceToUnity(UnityEditor.MenuCommand command)
=> command.context is XericImage;
[UnityEditor.MenuItem("CONTEXT/Image/Replace To/Unity Image", false, 100)]
[UnityEditor.MenuItem("CONTEXT/Image/Replace To/Unity Image (Native)", false, 100)]
private static void ReplaceToUnity(UnityEditor.MenuCommand command)
=> command.ReplaceCommandContext<XericImage, Image, Sprite>(
o =>
+2 -2
View File
@@ -198,11 +198,11 @@ namespace XericUI.OverrideUI
t.navigation = d.navigation;
});
[UnityEditor.MenuItem("CONTEXT/Button/Replace To/Unity Button", true)]
[UnityEditor.MenuItem("CONTEXT/Button/Replace To/Unity Button (Style)", true)]
private static bool ValidateReplaceStyleToUnity(UnityEditor.MenuCommand command)
=> command.context is XericStyleButton;
[UnityEditor.MenuItem("CONTEXT/Button/Replace To/Unity Button", false, 100)]
[UnityEditor.MenuItem("CONTEXT/Button/Replace To/Unity Button (Style)", false, 100)]
private static void ReplaceStyleToUnity(UnityEditor.MenuCommand command)
=> command.ReplaceCommandContext<XericStyleButton, Button,
(Graphic targetGraphic, ButtonClickedEvent onClick, Navigation navigation)>(
+2 -3
View File
@@ -16,7 +16,6 @@ namespace XericUI.OverrideUI
{
#region 序列化字段
[Header("图像样式")]
[SerializeField]
[Tooltip("颜色样式路径")]
private StyleField m_ColorStyle = new StyleField();
@@ -176,11 +175,11 @@ namespace XericUI.OverrideUI
o => o.sprite,
(t, d) => { t.sprite = d; });
[UnityEditor.MenuItem("CONTEXT/Image/Replace To/Unity Image", true)]
[UnityEditor.MenuItem("CONTEXT/Image/Replace To/Unity Image (Style)", true)]
private static bool ValidateReplaceStyleImageToUnity(UnityEditor.MenuCommand command)
=> command.context is XericStyleImage;
[UnityEditor.MenuItem("CONTEXT/Image/Replace To/Unity Image", false, 100)]
[UnityEditor.MenuItem("CONTEXT/Image/Replace To/Unity Image (Style)", false, 100)]
private static void ReplaceStyleImageToUnity(UnityEditor.MenuCommand command)
=> command.ReplaceCommandContext<XericStyleImage, Image, Sprite>(
o => o.sprite,
+2 -2
View File
@@ -253,11 +253,11 @@ namespace XericUI.OverrideUI
o => (o.graphic, o.group, o.onValueChanged, o.navigation),
(t, d) => { t.graphic = d.graphic; t.group = d.group; t.onValueChanged = d.onValueChanged; t.navigation = d.navigation; });
[UnityEditor.MenuItem("CONTEXT/Toggle/Replace To/Unity Toggle", true)]
[UnityEditor.MenuItem("CONTEXT/Toggle/Replace To/Unity Toggle (Style)", true)]
private static bool ValidateReplaceStyleToggleToUnity(UnityEditor.MenuCommand command)
=> command.context is XericStyleToggle;
[UnityEditor.MenuItem("CONTEXT/Toggle/Replace To/Unity Toggle", false, 100)]
[UnityEditor.MenuItem("CONTEXT/Toggle/Replace To/Unity Toggle (Style)", false, 100)]
private static void ReplaceStyleToggleToUnity(UnityEditor.MenuCommand command)
=> command.ReplaceCommandContext<XericStyleToggle, Toggle,
(Graphic graphic, ToggleGroup group, ToggleEvent onValueChanged, Navigation navigation)>(
+2 -2
View File
@@ -299,11 +299,11 @@ namespace XericUI
Debug.Log("请手动替换toggle下的Checkmark Image组件为XericImage,这样Toggle关闭时取消选中的状态会保持为ison状态");
}
[UnityEditor.MenuItem("CONTEXT/Toggle/Replace To/Unity Toggle", true)]
[UnityEditor.MenuItem("CONTEXT/Toggle/Replace To/Unity Toggle (Native)", true)]
private static bool ValidateReplaceToUnity(UnityEditor.MenuCommand command)
=> command.context is XericToggle;
[UnityEditor.MenuItem("CONTEXT/Toggle/Replace To/Unity Toggle", false, 100)]
[UnityEditor.MenuItem("CONTEXT/Toggle/Replace To/Unity Toggle (Native)", false, 100)]
private static void ReplaceToUnity(UnityEditor.MenuCommand command)
=> command.ReplaceCommandContext<XericToggle, Toggle,
(Graphic graphic, ToggleGroup group, ToggleEvent onValueChanged)>(
@@ -38,11 +38,11 @@ namespace XericUI.OverrideUI
o => (o.targetGraphic, o.onClick),
(t, d) => { t.targetGraphic = d.targetGraphic; t.onClick = d.onClick; });
[UnityEditor.MenuItem("CONTEXT/Button/Replace To/Unity Button", true)]
[UnityEditor.MenuItem("CONTEXT/Button/Replace To/Unity Button (Attribute)", true)]
private static bool ValidateReplaceToUnity(UnityEditor.MenuCommand command)
=> command.context is XericUIrAttributeButton;
[UnityEditor.MenuItem("CONTEXT/Button/Replace To/Unity Button", false, 100)]
[UnityEditor.MenuItem("CONTEXT/Button/Replace To/Unity Button (Attribute)", false, 100)]
private static void ReplaceToUnity(UnityEditor.MenuCommand command)
=> command.ReplaceCommandContext<XericUIrAttributeButton, Button,
(Graphic targetGraphic, Button.ButtonClickedEvent onClick)>(
+2 -2
View File
@@ -55,11 +55,11 @@ namespace XericUI.OverrideUI
o => o.sprite,
(t, d) => { t.sprite = d; });
[UnityEditor.MenuItem("CONTEXT/Image/Replace To/Unity Image", true)]
[UnityEditor.MenuItem("CONTEXT/Image/Replace To/Unity Image (Attribute)", true)]
private static bool ValidateReplaceToUnity(UnityEditor.MenuCommand command)
=> command.context is XericUIrAttributeText;
[UnityEditor.MenuItem("CONTEXT/Image/Replace To/Unity Image", false, 100)]
[UnityEditor.MenuItem("CONTEXT/Image/Replace To/Unity Image (Attribute)", false, 100)]
private static void ReplaceToUnity(UnityEditor.MenuCommand command)
=> command.ReplaceCommandContext<XericUIrAttributeText, Image, Sprite>(
o => o.sprite,
@@ -42,11 +42,11 @@ namespace XericUI.OverrideUI
t.onValueChanged = d.onValueChanged;
});
[UnityEditor.MenuItem("CONTEXT/Toggle/Replace To/Unity Toggle", true)]
[UnityEditor.MenuItem("CONTEXT/Toggle/Replace To/Unity Toggle (Attribute)", true)]
private static bool ValidateReplaceToUnity(UnityEditor.MenuCommand command)
=> command.context is XericUIrAttributeToggle;
[UnityEditor.MenuItem("CONTEXT/Toggle/Replace To/Unity Toggle", false, 100)]
[UnityEditor.MenuItem("CONTEXT/Toggle/Replace To/Unity Toggle (Attribute)", false, 100)]
private static void ReplaceToUnity(UnityEditor.MenuCommand command)
=> command.ReplaceCommandContext<XericUIrAttributeToggle, Toggle,
(Graphic graphic, ToggleGroup group, Toggle.ToggleEvent onValueChanged)>(