using UnityEditor; using System; using System.IO; [CustomEditor(typeof(SoSweepHit))] public class SoSweepHitEditor : SoConfigBaseEditor { [MenuItem("程序/角色相关/技能配置/SoSweepHit")] static void CreateSoFlyObject() { SoSweepHit _config = CreateInstance(); string _createName = string.Format(ScriptableObjectLoader.SoSweepHit_Suffix, DateTime.UtcNow.ToFileTimeUtc()); string _path = ResourcesPath.ResourcesOutPath + "refdata/ScriptableObject/SoSweepHit/"; if (Directory.Exists(_path) == false) { Directory.CreateDirectory(_path); } _path = StringUtility.Contact(ResourcesPath.ResourcesOutAssetPath, "refdata/ScriptableObject/SoSweepHit/", _createName, ".asset"); AssetDatabase.CreateAsset(_config, _path); AssetDatabase.Refresh(); ProjectWindowUtil.ShowCreatedAsset(_config); } }