diff --git a/Core/Script/_Setting/Editor.meta b/Core/EditorResources/Images.meta similarity index 77% rename from Core/Script/_Setting/Editor.meta rename to Core/EditorResources/Images.meta index 4a0d652..3f91a47 100644 --- a/Core/Script/_Setting/Editor.meta +++ b/Core/EditorResources/Images.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: b19a7a1a94ffa5f4b8e7e6f9366bd94f +guid: 46e15846d19d9a944821f2078f72fe8b folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Core/EditorResources/Icon_512.png b/Core/EditorResources/Images/Icon_512.png similarity index 100% rename from Core/EditorResources/Icon_512.png rename to Core/EditorResources/Images/Icon_512.png diff --git a/Core/EditorResources/Icon_512.png.meta b/Core/EditorResources/Images/Icon_512.png.meta similarity index 100% rename from Core/EditorResources/Icon_512.png.meta rename to Core/EditorResources/Images/Icon_512.png.meta diff --git a/Core/EditorResources/Icon_Pause.png b/Core/EditorResources/Images/Icon_Pause.png similarity index 100% rename from Core/EditorResources/Icon_Pause.png rename to Core/EditorResources/Images/Icon_Pause.png diff --git a/Core/EditorResources/Icon_Pause.png.meta b/Core/EditorResources/Images/Icon_Pause.png.meta similarity index 100% rename from Core/EditorResources/Icon_Pause.png.meta rename to Core/EditorResources/Images/Icon_Pause.png.meta diff --git a/Core/EditorResources/Icon_Play.png b/Core/EditorResources/Images/Icon_Play.png similarity index 100% rename from Core/EditorResources/Icon_Play.png rename to Core/EditorResources/Images/Icon_Play.png diff --git a/Core/EditorResources/Icon_Play.png.meta b/Core/EditorResources/Images/Icon_Play.png.meta similarity index 100% rename from Core/EditorResources/Icon_Play.png.meta rename to Core/EditorResources/Images/Icon_Play.png.meta diff --git a/Core/EditorResources/Icon_Refresh.png b/Core/EditorResources/Images/Icon_Refresh.png similarity index 100% rename from Core/EditorResources/Icon_Refresh.png rename to Core/EditorResources/Images/Icon_Refresh.png diff --git a/Core/EditorResources/Icon_Refresh.png.meta b/Core/EditorResources/Images/Icon_Refresh.png.meta similarity index 100% rename from Core/EditorResources/Icon_Refresh.png.meta rename to Core/EditorResources/Images/Icon_Refresh.png.meta diff --git a/Core/EditorResources/Icon_Setting.png b/Core/EditorResources/Images/Icon_Setting.png similarity index 100% rename from Core/EditorResources/Icon_Setting.png rename to Core/EditorResources/Images/Icon_Setting.png diff --git a/Core/EditorResources/Icon_Setting.png.meta b/Core/EditorResources/Images/Icon_Setting.png.meta similarity index 100% rename from Core/EditorResources/Icon_Setting.png.meta rename to Core/EditorResources/Images/Icon_Setting.png.meta diff --git a/Core/Resources/TweenEditorSetting.asset b/Core/EditorResources/TweenEditorSetting.asset similarity index 100% rename from Core/Resources/TweenEditorSetting.asset rename to Core/EditorResources/TweenEditorSetting.asset diff --git a/Core/Resources/TweenEditorSetting.asset.meta b/Core/EditorResources/TweenEditorSetting.asset.meta similarity index 100% rename from Core/Resources/TweenEditorSetting.asset.meta rename to Core/EditorResources/TweenEditorSetting.asset.meta diff --git a/Core/Script/Editor/Setting.meta b/Core/Script/Editor/Setting.meta new file mode 100644 index 0000000..b5551cd --- /dev/null +++ b/Core/Script/Editor/Setting.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: df400e24d0e8691458ec5d6cd996f074 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Core/Script/_Setting/TweenEditorSetting.cs b/Core/Script/Editor/Setting/TweenEditorSetting.cs similarity index 62% rename from Core/Script/_Setting/TweenEditorSetting.cs rename to Core/Script/Editor/Setting/TweenEditorSetting.cs index 9a55ca1..e4fd250 100644 --- a/Core/Script/_Setting/TweenEditorSetting.cs +++ b/Core/Script/Editor/Setting/TweenEditorSetting.cs @@ -6,11 +6,13 @@ // E-mail : ls9512@vip.qq.com // ///////////////////////////////////////////////////////////////////////////// +#if UNITY_EDITOR +using UnityEditor; using UnityEngine; namespace Aya.Tween { - [CreateAssetMenu(menuName = "UTween/Tween Setting", fileName = "TweenEditorSetting")] + [CreateAssetMenu(menuName = "UTween/Tween Editor Setting", fileName = "TweenEditorSetting")] public class TweenEditorSetting : ScriptableObject { #region Instance @@ -21,7 +23,7 @@ public static TweenEditorSetting Ins { if (Instance == null) { - Instance = Load(nameof(TweenEditorSetting)); + Instance = FindAsset(); } return Instance; @@ -30,12 +32,16 @@ public static TweenEditorSetting Ins protected static TweenEditorSetting Instance; - internal static TweenEditorSetting Load(string fileName) + internal static T FindAsset() where T : Object { - var ins = Resources.Load(fileName); - return ins; - } - + var guidList = AssetDatabase.FindAssets("t:" + typeof(T).FullName); + if (guidList != null && guidList.Length > 0) + { + return AssetDatabase.LoadAssetAtPath(AssetDatabase.GUIDToAssetPath(guidList[0])); + } + + return null; + } #endregion [Header("Icon")] @@ -45,3 +51,4 @@ internal static TweenEditorSetting Load(string fileName) public Texture2D IconRefresh; } } +#endif \ No newline at end of file diff --git a/Core/Script/_Setting/TweenEditorSetting.cs.meta b/Core/Script/Editor/Setting/TweenEditorSetting.cs.meta similarity index 100% rename from Core/Script/_Setting/TweenEditorSetting.cs.meta rename to Core/Script/Editor/Setting/TweenEditorSetting.cs.meta diff --git a/Core/Script/_Setting/Editor/TweenSettingProvider.cs b/Core/Script/Editor/Setting/TweenSettingProvider.cs similarity index 100% rename from Core/Script/_Setting/Editor/TweenSettingProvider.cs rename to Core/Script/Editor/Setting/TweenSettingProvider.cs diff --git a/Core/Script/_Setting/Editor/TweenSettingProvider.cs.meta b/Core/Script/Editor/Setting/TweenSettingProvider.cs.meta similarity index 100% rename from Core/Script/_Setting/Editor/TweenSettingProvider.cs.meta rename to Core/Script/Editor/Setting/TweenSettingProvider.cs.meta