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:
@@ -2,10 +2,11 @@ using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using XericUI.Helper;
|
||||
using XericUI.Core;
|
||||
|
||||
namespace XericUI.OverrideUI
|
||||
{
|
||||
[AddComponentMenu("Xeric UI Vessel/UI/Button", 50)]
|
||||
[AddComponentMenu(XericRegistrationPaths.UI + "/Button", 50)]
|
||||
public class XericButton : Button
|
||||
{
|
||||
|
||||
@@ -168,11 +169,11 @@ namespace XericUI.OverrideUI
|
||||
|
||||
#region 组件替换
|
||||
#if UNITY_EDITOR
|
||||
[UnityEditor.MenuItem("CONTEXT/Button/Replace To/Xeric Button", true)]
|
||||
[UnityEditor.MenuItem(XericRegistrationPaths.ContextPrefix + "Button/Replace To/Xeric Button", true)]
|
||||
private static bool ValidateReplaceToXeric(UnityEditor.MenuCommand command)
|
||||
=> command.context is Button and not XericButton;
|
||||
|
||||
[UnityEditor.MenuItem("CONTEXT/Button/Replace To/Xeric Button", false, 10)]
|
||||
[UnityEditor.MenuItem(XericRegistrationPaths.ContextPrefix + "Button/Replace To/Xeric Button", false, 10)]
|
||||
private static void ReplaceToXeric(UnityEditor.MenuCommand command)
|
||||
=> command.ReplaceCommandContext<Button, XericButton,
|
||||
(Graphic targetGraphic, ButtonClickedEvent onClick)>(
|
||||
@@ -184,11 +185,11 @@ namespace XericUI.OverrideUI
|
||||
t.onClick = d.onClick;
|
||||
});
|
||||
|
||||
[UnityEditor.MenuItem("CONTEXT/Button/Replace To/Unity Button (Native)", true)]
|
||||
[UnityEditor.MenuItem(XericRegistrationPaths.ContextPrefix + "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 (Native)", false, 100)]
|
||||
[UnityEditor.MenuItem(XericRegistrationPaths.ContextPrefix + "Button/Replace To/Unity Button (Native)", false, 100)]
|
||||
private static void ReplaceToUnity(UnityEditor.MenuCommand command)
|
||||
=> command.ReplaceCommandContext<XericButton, Button,
|
||||
(Graphic targetGraphic, ButtonClickedEvent onClick)>(
|
||||
|
||||
Reference in New Issue
Block a user