123456789101112131415161718192021222324252627282930313233343536 |
- using UnityEditor;
- using UnityEngine;
- namespace FL.Editor.Imports
- {
- [System.Serializable]
- public struct PathValues
- {
- [Header("外部相对路径")]
- [Tooltip("customModelsPath的子文件夹")]
- public string from;
- [Header("目标文件夹")]
- public string to;
- }
- /// <summary>
- /// 导入外部模型的配置文件
- /// </summary>
- [CreateAssetMenu(fileName = "CustomModelConfig", menuName = "XGame/模型导入配置")]
- public class CustomModelConfig : ScriptableObject
- {
- [Header("外部模型根目录")]
- public string customModelsPath;
- public PathValues[] paths;
- #region 静态方法
- public static CustomModelConfig Load()
- {
- var guids = AssetDatabase.FindAssets(typeof(CustomModelConfig).Name);
- if (guids.Length == 0)
- return null;
- var assetPath = AssetDatabase.GUIDToAssetPath(guids[0]);
- return AssetDatabase.LoadAssetAtPath<CustomModelConfig>(assetPath);
- }
- #endregion
- }
- }
|