diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Config/Editor/TypeRegistryUserConfig.asset b/Assets/Plugins/Sirenix/Odin Inspector/Config/Editor/TypeRegistryUserConfig.asset new file mode 100644 index 0000000..18bf021 --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Config/Editor/TypeRegistryUserConfig.asset @@ -0,0 +1,24 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 2050440665, guid: a4865f1ab4504ed8a368670db22f409c, type: 3} + m_Name: TypeRegistryUserConfig + m_EditorClassIdentifier: + shownTypes: + serializedCollection: [] + hiddenTypes: + serializedCollection: [] + addedIllegalTypes: + serializedCollection: [] + typeSettings: + serializedDictionary: [] + typePriorities: + serializedDictionary: [] diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Config/Editor/TypeRegistryUserConfig.asset.meta b/Assets/Plugins/Sirenix/Odin Inspector/Config/Editor/TypeRegistryUserConfig.asset.meta new file mode 100644 index 0000000..db069cc --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Config/Editor/TypeRegistryUserConfig.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 25e2868b70073ff4e8be4fe3a2fdc290 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Config/Resources.meta b/Assets/Plugins/Sirenix/Odin Inspector/Config/Resources.meta new file mode 100644 index 0000000..2b0a6b4 --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Config/Resources.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 76c4a9ac37c5725429d74e50b3acc481 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Config/Resources/Sirenix.meta b/Assets/Plugins/Sirenix/Odin Inspector/Config/Resources/Sirenix.meta new file mode 100644 index 0000000..8c63f02 --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Config/Resources/Sirenix.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c4dd5d6aa7f5a4e46a8d8af3e68ae934 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Config/Resources/Sirenix/GlobalSerializationConfig.asset b/Assets/Plugins/Sirenix/Odin Inspector/Config/Resources/Sirenix/GlobalSerializationConfig.asset new file mode 100644 index 0000000..0e48b68 --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Config/Resources/Sirenix/GlobalSerializationConfig.asset @@ -0,0 +1,22 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1549551891, guid: 74721b9f0af448f5ae2e91102a1a5edd, type: 3} + m_Name: GlobalSerializationConfig + m_EditorClassIdentifier: + HideSerializationCautionaryMessage: 0 + HidePrefabCautionaryMessage: 0 + HideOdinSerializeAttributeWarningMessages: 0 + HideNonSerializedShowInInspectorWarningMessages: 0 + buildSerializationFormat: 0 + editorSerializationFormat: 2 + loggingPolicy: 0 + errorHandlingPolicy: 0 diff --git a/Assets/Plugins/Sirenix/Odin Inspector/Config/Resources/Sirenix/GlobalSerializationConfig.asset.meta b/Assets/Plugins/Sirenix/Odin Inspector/Config/Resources/Sirenix/GlobalSerializationConfig.asset.meta new file mode 100644 index 0000000..14ae107 --- /dev/null +++ b/Assets/Plugins/Sirenix/Odin Inspector/Config/Resources/Sirenix/GlobalSerializationConfig.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b8030d3f9b93fe54eb0bb57228abeb2c +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Unity-Tools/Demo/Unity-Tools.Demo.asmdef b/Assets/Unity-Tools/Demo/Unity-Tools.Demo.asmdef index 95f7250..6e8ff4a 100644 --- a/Assets/Unity-Tools/Demo/Unity-Tools.Demo.asmdef +++ b/Assets/Unity-Tools/Demo/Unity-Tools.Demo.asmdef @@ -2,11 +2,11 @@ "name": "Unity-Tools.Demo", "rootNamespace": "", "references": [ - "GUID:a1f7e93dbeee5cb41aa91ead2e679308", - "GUID:9e24947de15b9834991c9d8411ea37cf", - "GUID:84651a3751eca9349aac36a66bba901b", - "GUID:f51ebe6a0ceec4240a699833d6309b23", - "GUID:593a5b492d29ac6448b1ebf7f035ef33" + "Unity-Tools", + "Unity.Addressables", + "Unity.ResourceManager", + "UniTask", + "UniTask.Addressables" ], "includePlatforms": [], "excludePlatforms": [], diff --git a/Assets/Unity-Tools/ExcelResolver/Editor/Core/Util/ExcelResolverUtil.Type.cs b/Assets/Unity-Tools/ExcelResolver/Editor/Core/Util/ExcelResolverUtil.Type.cs index 4d49650..f9c7bd4 100644 --- a/Assets/Unity-Tools/ExcelResolver/Editor/Core/Util/ExcelResolverUtil.Type.cs +++ b/Assets/Unity-Tools/ExcelResolver/Editor/Core/Util/ExcelResolverUtil.Type.cs @@ -56,12 +56,12 @@ namespace Tools.ExcelResolver.Editor foreach (var assembly in assemblies) { var type = assembly.GetType(fullTypeName); - if (assembly.GetName().Name is "Assembly-CSharp-Editor" or "Assembly-CSharp-Editor-firstpass") - { - throw new ArgumentException($"不支持Editor目录下的'{fullTypeName}'类型"); - } if (type != null) { + if (assembly.GetName().Name is "Assembly-CSharp-Editor" or "Assembly-CSharp-Editor-firstpass") + { + throw new ArgumentException($"不支持Editor目录下的'{fullTypeName}'类型"); + } TypeCache[fullTypeName] = type; return type; } diff --git a/Assets/Unity-Tools/ExcelResolver/Editor/ExcelResolverEditorConfig.asset b/Assets/Unity-Tools/ExcelResolver/Editor/ExcelResolverEditorConfig.asset index e53f374..4257da7 100644 --- a/Assets/Unity-Tools/ExcelResolver/Editor/ExcelResolverEditorConfig.asset +++ b/Assets/Unity-Tools/ExcelResolver/Editor/ExcelResolverEditorConfig.asset @@ -12,8 +12,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 9247b1b02271436ca893eadb1fa8bdce, type: 3} m_Name: ExcelResolverEditorConfig m_EditorClassIdentifier: - ExcelPathRoot: Assets/ExcelResolver/Excel - JsonPathRoot: Assets/ExcelResolver/Json - CodePathRoot: Assets/Scripts/Generator/Excel + ExcelPathRoot: Assets/_Project/ExcelResolver/Excel + CodePathRoot: Assets/_Project/Scripts/Generator/Excel + SOPathRoot: Assets/_Project/ScriptableObject/Excel GenerateDataClassNameSpace: Tools.ExcelResolver - isInit: 0 diff --git a/Assets/Unity-Tools/ExcelResolver/Editor/ExcelResolverEditorConfig.cs b/Assets/Unity-Tools/ExcelResolver/Editor/ExcelResolverEditorConfig.cs index 0387d8a..7abbe8b 100644 --- a/Assets/Unity-Tools/ExcelResolver/Editor/ExcelResolverEditorConfig.cs +++ b/Assets/Unity-Tools/ExcelResolver/Editor/ExcelResolverEditorConfig.cs @@ -8,11 +8,11 @@ namespace Tools.ExcelResolver.Editor public sealed class ExcelResolverEditorConfig : ScriptableObject { [LabelText("Excel路径"), FolderPath] - public string ExcelPathRoot = "Assets/ExcelResolver/Excel"; + public string ExcelPathRoot = "Assets/_Project/ExcelResolver/Excel"; [LabelText("C#代码路径"), ValueDropdown("@Tools.Editor.DirectoryUtil.GetFilePaths()")] - public string CodePathRoot = "Assets/Scripts/Generator/Excel"; + public string CodePathRoot = "Assets/_Project/Scripts/Generator/Excel"; [LabelText("SO存放路径"), ValueDropdown("@Tools.Editor.DirectoryUtil.GetFilePaths()")] - public string SOPathRoot = "Assets/ScriptableObject/Excel"; + public string SOPathRoot = "Assets/_Project/ScriptableObject/Excel"; [LabelText("生成代码命名空间")] public string GenerateDataClassNameSpace = "Tools.ExcelResolver"; diff --git a/Assets/Unity-Tools/ExcelResolver/Editor/ExcelResolverEditorWindow.cs b/Assets/Unity-Tools/ExcelResolver/Editor/ExcelResolverEditorWindow.cs index 853219e..dc9823d 100644 --- a/Assets/Unity-Tools/ExcelResolver/Editor/ExcelResolverEditorWindow.cs +++ b/Assets/Unity-Tools/ExcelResolver/Editor/ExcelResolverEditorWindow.cs @@ -25,8 +25,17 @@ namespace Tools.ExcelResolver.Editor if (excelResolverConfig == null) { string[] assetGuids = AssetDatabase.FindAssets($"ExcelResolverEditorConfig t:ExcelResolverEditorConfig"); - string assetPath = AssetDatabase.GUIDToAssetPath(assetGuids[0]); - excelResolverConfig = AssetDatabase.LoadAssetAtPath(assetPath); + if (assetGuids.Length > 0) + { + string assetPath = AssetDatabase.GUIDToAssetPath(assetGuids[0]); + excelResolverConfig = AssetDatabase.LoadAssetAtPath(assetPath); + } + else + { + excelResolverConfig = CreateInstance(); + AssetDatabase.CreateAsset(excelResolverConfig, "Assets/Unity-Tools/ExcelResolver/Editor/ExcelResolverEditorConfig.asset"); + AssetDatabase.SaveAssets(); + } } } diff --git a/Assets/_Project/ExcelResolver.meta b/Assets/_Project/ExcelResolver.meta new file mode 100644 index 0000000..d4adf0f --- /dev/null +++ b/Assets/_Project/ExcelResolver.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 46522688344b9244693521456a7deb41 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Project/ExcelResolver/Excel.meta b/Assets/_Project/ExcelResolver/Excel.meta new file mode 100644 index 0000000..4cb507c --- /dev/null +++ b/Assets/_Project/ExcelResolver/Excel.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f1554c02a4e515b4b8953edbfa311896 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Project/ExcelResolver/Excel/hero.xlsx b/Assets/_Project/ExcelResolver/Excel/hero.xlsx new file mode 100644 index 0000000..6c281b5 Binary files /dev/null and b/Assets/_Project/ExcelResolver/Excel/hero.xlsx differ diff --git a/Assets/_Project/ExcelResolver/Excel/hero.xlsx.meta b/Assets/_Project/ExcelResolver/Excel/hero.xlsx.meta new file mode 100644 index 0000000..dd932c3 --- /dev/null +++ b/Assets/_Project/ExcelResolver/Excel/hero.xlsx.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: d158d305a64ac74428b71f7a8f6ae16c +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Project/ScriptableObject.meta b/Assets/_Project/ScriptableObject.meta new file mode 100644 index 0000000..8284234 --- /dev/null +++ b/Assets/_Project/ScriptableObject.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 238b5e359150ae04fa915c27485e3708 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Project/ScriptableObject/Excel.meta b/Assets/_Project/ScriptableObject/Excel.meta new file mode 100644 index 0000000..bf4429a --- /dev/null +++ b/Assets/_Project/ScriptableObject/Excel.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 7263635733ca40c48b9c2cb5a11cd653 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Project/ScriptableObject/Excel/Hero_1.asset b/Assets/_Project/ScriptableObject/Excel/Hero_1.asset new file mode 100644 index 0000000..8f7199f --- /dev/null +++ b/Assets/_Project/ScriptableObject/Excel/Hero_1.asset @@ -0,0 +1,28 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e8aa3c1560079b84cafbabe4bc0d2c8d, type: 3} + m_Name: Hero_1 + m_EditorClassIdentifier: + id: 1 + name: "\u9053\u58EB" + icon: hero_1 + has: 0 + hp: 100 + atk: 20 + speed: 1.2 + pos: {x: 0, y: 1, z: 4} + ches: {x: 0, y: 1} + attack_target: + - 0.5 + - -2.6 + - 3 + - 4.5 diff --git a/Assets/_Project/ScriptableObject/Excel/Hero_1.asset.meta b/Assets/_Project/ScriptableObject/Excel/Hero_1.asset.meta new file mode 100644 index 0000000..2894836 --- /dev/null +++ b/Assets/_Project/ScriptableObject/Excel/Hero_1.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4f581fc84b82a7f4da23f932e6ed3d38 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Project/ScriptableObject/Excel/Hero_2.asset b/Assets/_Project/ScriptableObject/Excel/Hero_2.asset new file mode 100644 index 0000000..99e9164 --- /dev/null +++ b/Assets/_Project/ScriptableObject/Excel/Hero_2.asset @@ -0,0 +1,24 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e8aa3c1560079b84cafbabe4bc0d2c8d, type: 3} + m_Name: Hero_2 + m_EditorClassIdentifier: + id: 2 + name: + icon: hero_2 + has: 1 + hp: 150 + atk: 0 + speed: 0 + pos: {x: 0, y: 0, z: 0} + ches: {x: 0, y: 0} + attack_target: [] diff --git a/Assets/_Project/ScriptableObject/Excel/Hero_2.asset.meta b/Assets/_Project/ScriptableObject/Excel/Hero_2.asset.meta new file mode 100644 index 0000000..e73dbfd --- /dev/null +++ b/Assets/_Project/ScriptableObject/Excel/Hero_2.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 7a59ffde55e89f148be41e4d40255f16 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Project/ScriptableObject/Excel/Hero_3.asset b/Assets/_Project/ScriptableObject/Excel/Hero_3.asset new file mode 100644 index 0000000..b74aae5 --- /dev/null +++ b/Assets/_Project/ScriptableObject/Excel/Hero_3.asset @@ -0,0 +1,25 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e8aa3c1560079b84cafbabe4bc0d2c8d, type: 3} + m_Name: Hero_3 + m_EditorClassIdentifier: + id: 2 + name: "\u5973\u5DEB" + icon: hero_3 + has: 0 + hp: 80 + atk: 8 + speed: 1.1 + pos: {x: 3, y: 2, z: 4} + ches: {x: 5, y: 12} + attack_target: + - 2.5 diff --git a/Assets/_Project/ScriptableObject/Excel/Hero_3.asset.meta b/Assets/_Project/ScriptableObject/Excel/Hero_3.asset.meta new file mode 100644 index 0000000..ce38eff --- /dev/null +++ b/Assets/_Project/ScriptableObject/Excel/Hero_3.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 226d036514514d14c8566a97edac7c9e +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Project/Scripts.meta b/Assets/_Project/Scripts.meta new file mode 100644 index 0000000..255102d --- /dev/null +++ b/Assets/_Project/Scripts.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 68764e3ec69209448b59cc4903d361f9 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Project/Scripts/Generator.meta b/Assets/_Project/Scripts/Generator.meta new file mode 100644 index 0000000..69f8bc0 --- /dev/null +++ b/Assets/_Project/Scripts/Generator.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: eb473f9b25d86d6449c922ea70ff3338 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Project/Scripts/Generator/Excel.meta b/Assets/_Project/Scripts/Generator/Excel.meta new file mode 100644 index 0000000..2f77427 --- /dev/null +++ b/Assets/_Project/Scripts/Generator/Excel.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 7acf5756494783c4e9c6d7a6f73b3f2f +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Project/Scripts/Generator/Excel/Hero.cs b/Assets/_Project/Scripts/Generator/Excel/Hero.cs new file mode 100644 index 0000000..55fead2 --- /dev/null +++ b/Assets/_Project/Scripts/Generator/Excel/Hero.cs @@ -0,0 +1,72 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Tools.ExcelResolver +{ + using System; + using System.Collections; + using System.Collections.Generic; + using UnityEngine; + + + public class Hero : ScriptableObject, IExcelData + { + + /// + /// 英雄 + /// + public int id; + + /// + /// 名称 + /// + public string name; + + /// + /// icon + /// + public string icon; + + /// + /// 有宠物 + /// + public bool has; + + /// + /// 血量 + /// + public int hp; + + /// + /// 攻击力 + /// + public int atk; + + /// + /// 移速 + /// + public float speed; + + /// + /// 位置 + /// + public Vector3 pos; + + /// + /// 位置 + /// + public Vector2 ches; + + /// + /// 攻击优先级 + /// + public List attack_target; + } +} diff --git a/Assets/_Project/Scripts/Generator/Excel/Hero.cs.meta b/Assets/_Project/Scripts/Generator/Excel/Hero.cs.meta new file mode 100644 index 0000000..1f1b4bc --- /dev/null +++ b/Assets/_Project/Scripts/Generator/Excel/Hero.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: e8aa3c1560079b84cafbabe4bc0d2c8d \ No newline at end of file diff --git a/Assets/_Project/Scripts/Generator/Excel/HeroUtil.cs b/Assets/_Project/Scripts/Generator/Excel/HeroUtil.cs new file mode 100644 index 0000000..052db47 --- /dev/null +++ b/Assets/_Project/Scripts/Generator/Excel/HeroUtil.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Tools.ExcelResolver +{ + using System; + using System.Collections; + using System.Collections.Generic; + using UnityEngine; + using Sirenix.OdinInspector; + + + public class HeroUtil : SerializedScriptableObject, IExcelSO + { + + public Dictionary Data; + } +} diff --git a/Assets/_Project/Scripts/Generator/Excel/HeroUtil.cs.meta b/Assets/_Project/Scripts/Generator/Excel/HeroUtil.cs.meta new file mode 100644 index 0000000..9ae8108 --- /dev/null +++ b/Assets/_Project/Scripts/Generator/Excel/HeroUtil.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 0b8ec7437f31db141b138472f0c2a3aa \ No newline at end of file