using UnityEngine; using System.Collections.Generic; #if UNITY_EDITOR using UnityEditor; using System.IO; using System; #endif public class HorseEffectConfig : ScriptableObject { public List effectConfigList; [System.Serializable] public class EffectConfig { public string modelName; public List boneNameList; public List effectNameList; } } #if UNITY_EDITOR [CustomEditor(typeof(HorseEffectConfig))] public class HorseEffectConfigEditor : Editor { [MenuItem("程序/角色相关/坐骑特效配置")] static void CreateHorseEffectConfig() { HorseEffectConfig _config = CreateInstance(); string _name = "horseEffectConfig"; string _path = ResourcesPath.ResourcesOutPath + "Gmodels"; if (Directory.Exists(_path) == false) { Directory.CreateDirectory(_path); } _path = StringUtility.Contact(ResourcesPath.ResourcesOutAssetPath, "Gmodels/", _name, ".asset"); AssetDatabase.CreateAsset(_config, _path); AssetDatabase.Refresh(); ProjectWindowUtil.ShowCreatedAsset(_config); } } #endif