using UnityEditor; using System; using System.IO; public class SoActorEditor : Editor { [MenuItem("程序/角色相关/角色配置 SoActor")] static void CreateSoActor() { SoActor _soActor = CreateInstance(); string _createName = string.Format(ScriptableObjectLoader.SoActor_Suffix, DateTime.UtcNow.ToFileTimeUtc()); string _path = ResourcesPath.ResourcesOutPath + "refdata/ScriptableObject/SoActor/"; if (Directory.Exists(_path) == false) { Directory.CreateDirectory(_path); } _path = StringUtility.Contact(ResourcesPath.ResourcesOutAssetPath, "refdata/ScriptableObject/SoActor/", _createName, ".asset"); AssetDatabase.CreateAsset(_soActor, _path); AssetDatabase.Refresh(); ProjectWindowUtil.ShowCreatedAsset(_soActor); } }