com.alicizax.unity/Editor/Constant/FrameworkAssetInitlized.cs

37 lines
1.1 KiB
C#
Raw Normal View History

2025-02-10 15:29:53 +08:00
using System.IO;
using AlicizaX.Runtime;
using UnityEditor;
using UnityEngine;
namespace AlicizaX.Editor
{
static class FrameworkAssetInitlized
{
2025-02-18 16:04:21 +08:00
[InitializeOnLoadMethod]
2025-02-10 15:29:53 +08:00
static void Initlize()
{
string FloderPath = "Assets/Resources/";
if (!Directory.Exists(FloderPath))
{
Directory.CreateDirectory(FloderPath);
}
string publisherPath = Path.Combine(FloderPath, "FrameworkPublishSettings.asset");
string hotPath = Path.Combine(FloderPath, "FrameworkHotUpdateSettings.asset");
if (!File.Exists(publisherPath))
{
var publisherObject = ScriptableObject.CreateInstance<FrameworkPublishSettings>();
AssetDatabase.CreateAsset(publisherObject, publisherPath);
}
if (!File.Exists(hotPath))
{
var hotObject = ScriptableObject.CreateInstance<FrameworkHotUpdateSettings>();
AssetDatabase.CreateAsset(hotObject, hotPath);
}
AssetDatabase.Refresh();
}
}
}