refactor(注册路径): 调用点收进 XericRegistrationPaths,46 个文件只动注册属性行
10-27 那笔把表的根定成 XericLibrary,但 58 处 AddComponentMenu、4 处 CreateAssetMenu 和若干 MenuItem/ContextMenu 还各自写着 "Xeric UI Vessel/…"、"Xeric/XChart/…" 三套 旧字面量;那批转换一直停在工程里没提交。本笔只收这 46 个"除注册属性外没有别的改动" 的文件,路径出处从此只在表里一处。 工作区里另外 3 个文件(XericImage 的角偏移、IVisibility 接口、XericInfiniteVesselBase 的 region/注释)混着功能改动,不在本笔;Editor/OverrideUI/XericImageEditor.cs 与 Runtime/OverrideUI/XericImageDeform.cs 两个未入库新文件也不在。
This commit is contained in:
@@ -4,6 +4,7 @@ using UnityEngine.UI;
|
||||
using XericLibrary.Runtime.SuperStyleSheet;
|
||||
using XericUI.Core.StyleSheetUI;
|
||||
using XericUI.Helper;
|
||||
using XericUI.Core;
|
||||
|
||||
namespace XericUI.OverrideUI
|
||||
{
|
||||
@@ -11,7 +12,7 @@ namespace XericUI.OverrideUI
|
||||
/// 基于 SuperStyleSheet 的图像组件。
|
||||
/// 使用 StyleField 引用样式表中的颜色和纹理路径,样式变更时自动刷新。
|
||||
/// </summary>
|
||||
[AddComponentMenu("Xeric UI Vessel/UI/Style Image", 53)]
|
||||
[AddComponentMenu(XericRegistrationPaths.UI + "/Style Image", 53)]
|
||||
public class XericStyleImage : Image
|
||||
{
|
||||
#region 序列化字段
|
||||
@@ -165,21 +166,21 @@ namespace XericUI.OverrideUI
|
||||
#region 组件替换
|
||||
|
||||
#if UNITY_EDITOR
|
||||
[UnityEditor.MenuItem("CONTEXT/Image/Replace To/Xeric (Style)", true)]
|
||||
[UnityEditor.MenuItem(XericRegistrationPaths.ContextPrefix + "Image/Replace To/Xeric (Style)", true)]
|
||||
private static bool ValidateReplaceToStyleImage(UnityEditor.MenuCommand command)
|
||||
=> command.context is Image and not XericStyleImage;
|
||||
|
||||
[UnityEditor.MenuItem("CONTEXT/Image/Replace To/Xeric (Style)", false, 11)]
|
||||
[UnityEditor.MenuItem(XericRegistrationPaths.ContextPrefix + "Image/Replace To/Xeric (Style)", false, 11)]
|
||||
private static void ReplaceToStyleImage(UnityEditor.MenuCommand command)
|
||||
=> command.ReplaceCommandContext<Image, XericStyleImage, Sprite>(
|
||||
o => o.sprite,
|
||||
(t, d) => { t.sprite = d; });
|
||||
|
||||
[UnityEditor.MenuItem("CONTEXT/Image/Replace To/Unity Image (Style)", true)]
|
||||
[UnityEditor.MenuItem(XericRegistrationPaths.ContextPrefix + "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 (Style)", false, 100)]
|
||||
[UnityEditor.MenuItem(XericRegistrationPaths.ContextPrefix + "Image/Replace To/Unity Image (Style)", false, 100)]
|
||||
private static void ReplaceStyleImageToUnity(UnityEditor.MenuCommand command)
|
||||
=> command.ReplaceCommandContext<XericStyleImage, Image, Sprite>(
|
||||
o => o.sprite,
|
||||
|
||||
Reference in New Issue
Block a user