diff --git a/Assets/AddressableAssetsData/link.xml b/Assets/AddressableAssetsData/link.xml deleted file mode 100644 index 63db36922..000000000 --- a/Assets/AddressableAssetsData/link.xml +++ /dev/null @@ -1,528 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Assets/AddressableAssetsData/link.xml.meta b/Assets/Editor/UXML/AnimatorLinker.meta similarity index 57% rename from Assets/AddressableAssetsData/link.xml.meta rename to Assets/Editor/UXML/AnimatorLinker.meta index 8c01dea86..0e413b759 100644 --- a/Assets/AddressableAssetsData/link.xml.meta +++ b/Assets/Editor/UXML/AnimatorLinker.meta @@ -1,6 +1,7 @@ fileFormatVersion: 2 -guid: 48b54d35ebbd16042a546482cf57c917 -TextScriptImporter: +guid: afc01321d5046a141bba1f84dd41e8cc +folderAsset: yes +DefaultImporter: externalObjects: {} userData: assetBundleName: diff --git a/Assets/Editor/UXML/AnimatorLinker/AnimatorClipLink.cs b/Assets/Editor/UXML/AnimatorLinker/AnimatorClipLink.cs new file mode 100644 index 000000000..461825425 --- /dev/null +++ b/Assets/Editor/UXML/AnimatorLinker/AnimatorClipLink.cs @@ -0,0 +1,298 @@ +using System; +using System.IO; +using System.Linq; +using JetBrains.Annotations; +using UnityEditor; +using UnityEditor.Animations; +using UnityEditor.UIElements; +using UnityEngine; +using UnityEngine.UIElements; +using Object = UnityEngine.Object; + +namespace AibisDream.SystemEditor +{ + public class AnimatorClipLink : EditorWindow + { + [SerializeField] private VisualTreeAsset visualTreeAsset; + + private ObjectField _animatorField; + private Label _animatorMessage; + private ListView _stateInfoView; + + private TextField _clipsPathField; + private Label _clipsMessage; + private ListView _clipsNameList; + + private HelpBox _matchMessageBox; + + #region 部分缓存 + + private static AnimatorController _animatorCache; + private static string _clipsPathCache; + + private ChildAnimatorState[] _statesCache; + private string[] _clipsCache; + + private bool _isChecked; + private bool _allMatched; + private bool _isAllLoad; + + #endregion + + [MenuItem("Tools/AnimatorClipLink")] + public static void ShowExample() + { + AnimatorClipLink wnd = GetWindow(); + wnd.titleContent = new GUIContent("AnimatorClipLink"); + } + + public void CreateGUI() + { + // Each editor window contains a root VisualElement object + VisualElement root = rootVisualElement; + + // Instantiate UXML + root.Add(visualTreeAsset.Instantiate()); + + // 注册一些事件 + _animatorField = root.Q("animator-field"); + _animatorField.RegisterValueChangedCallback(OnAnimatorChanged); + _animatorMessage = root.Q