少年修仙传客户端代码仓库
hch
2025-06-12 204ef05a831c9484e2abc561d27ecbff7c797453
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
using UnityEngine;
using System.Collections.Generic;
 
#if UNITY_EDITOR
using UnityEditor;
using System.IO;
using System;
#endif
 
public class HorseEffectConfig : ScriptableObject
{
    public List<EffectConfig> effectConfigList;
 
    [System.Serializable]
    public class EffectConfig
    {
        public string modelName;
        public List<string> boneNameList;
        public List<string> effectNameList;
    }
 
}
 
#if UNITY_EDITOR
 
 
 
[CustomEditor(typeof(HorseEffectConfig))]
public class HorseEffectConfigEditor : Editor
{
    [MenuItem("程序/角色相关/坐骑特效配置")]
    static void CreateHorseEffectConfig()
    {
        HorseEffectConfig _config = CreateInstance<HorseEffectConfig>();
        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