2025-03-31 11:16:52 +08:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.IO;
|
|
|
|
|
|
using System.Linq;
|
2025-07-02 16:28:08 +08:00
|
|
|
|
#if HotUpdate
|
2025-03-31 11:16:52 +08:00
|
|
|
|
using HybridCLR.Editor;
|
|
|
|
|
|
using HybridCLR.Editor.Settings;
|
2025-07-02 16:28:08 +08:00
|
|
|
|
#endif
|
2025-03-31 11:16:52 +08:00
|
|
|
|
using Sirenix.OdinInspector;
|
|
|
|
|
|
using Sirenix.OdinInspector.Editor;
|
|
|
|
|
|
using UnityEditor;
|
|
|
|
|
|
using UnityEditorInternal;
|
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Stary.Evo.Editor
|
|
|
|
|
|
{
|
|
|
|
|
|
public class CreatAssetWindow : OdinEditorWindow
|
|
|
|
|
|
{
|
2025-10-24 19:08:10 +08:00
|
|
|
|
[MenuItem("Evo/Dev/创建Domain作用域",false, 1)]
|
2025-03-31 11:16:52 +08:00
|
|
|
|
static void Init()
|
|
|
|
|
|
{
|
|
|
|
|
|
// Get existing open window or if none, make a new one:
|
|
|
|
|
|
CreatAssetWindow window = (CreatAssetWindow)EditorWindow.GetWindow(typeof(CreatAssetWindow));
|
|
|
|
|
|
window.Show();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[TitleGroup("创建Domain作用域")] public string domain;
|
|
|
|
|
|
|
|
|
|
|
|
[TitleGroup("创建Domain作用域")]
|
|
|
|
|
|
[Button("创建Domain", ButtonSizes.Large)]
|
|
|
|
|
|
public async void CreatDomain()
|
|
|
|
|
|
{
|
2025-04-11 09:56:06 +08:00
|
|
|
|
// if (GetCreatDomainAll().Count>0)
|
|
|
|
|
|
// {
|
|
|
|
|
|
// EditorUtility.DisplayDialog("错误!", "Domain仅可以创建一个,请在下方删除存在的Domain", "确定");
|
|
|
|
|
|
// return;
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
2025-03-31 11:16:52 +08:00
|
|
|
|
if (string.IsNullOrEmpty(domain))
|
|
|
|
|
|
{
|
|
|
|
|
|
EditorUtility.DisplayDialog("错误!", "请输入将要创建Domain的编号", "确定");
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
2025-04-11 09:56:06 +08:00
|
|
|
|
|
|
|
|
|
|
string artDomainPath = $"{Application.dataPath}/Art/{domain}";
|
|
|
|
|
|
if (!Directory.Exists(artDomainPath))
|
|
|
|
|
|
{
|
|
|
|
|
|
Directory.CreateDirectory(artDomainPath);
|
|
|
|
|
|
|
2025-04-16 18:20:46 +08:00
|
|
|
|
if (!Directory.Exists(artDomainPath))
|
2025-07-02 16:28:08 +08:00
|
|
|
|
//创建Animation文件夹
|
|
|
|
|
|
CreatDirectory(artDomainPath + "/Animation");
|
2025-04-11 09:56:06 +08:00
|
|
|
|
//创建Effects文件夹
|
2025-04-16 18:20:46 +08:00
|
|
|
|
CreatDirectory(artDomainPath + "/Effects");
|
2025-04-11 09:56:06 +08:00
|
|
|
|
//创建Fbx文件夹
|
2025-04-16 18:20:46 +08:00
|
|
|
|
CreatDirectory(artDomainPath + "/Fbx");
|
2025-04-11 09:56:06 +08:00
|
|
|
|
//创建Font文件夹
|
2025-04-16 18:20:46 +08:00
|
|
|
|
CreatDirectory(artDomainPath + "/Font");
|
2025-04-11 09:56:06 +08:00
|
|
|
|
//创建Materials文件夹
|
2025-04-16 18:20:46 +08:00
|
|
|
|
CreatDirectory(artDomainPath + "/Materials");
|
2025-04-11 09:56:06 +08:00
|
|
|
|
//创建Prefabs文件夹
|
2025-04-16 18:20:46 +08:00
|
|
|
|
CreatDirectory(artDomainPath + "/Prefabs");
|
2025-04-11 09:56:06 +08:00
|
|
|
|
//创建Scenes文件夹
|
2025-04-16 18:20:46 +08:00
|
|
|
|
CreatDirectory(artDomainPath + "/Scenes");
|
2025-04-11 09:56:06 +08:00
|
|
|
|
//创建/Scenes/Test文件夹
|
2025-04-16 18:20:46 +08:00
|
|
|
|
CreatDirectory(artDomainPath + "/Scenes/Test");
|
2025-04-11 09:56:06 +08:00
|
|
|
|
//创建Shader文件夹
|
2025-04-16 18:20:46 +08:00
|
|
|
|
CreatDirectory(artDomainPath + "/Shader");
|
2025-04-11 09:56:06 +08:00
|
|
|
|
//创建Textures文件夹
|
2025-04-16 18:20:46 +08:00
|
|
|
|
CreatDirectory(artDomainPath + "/Textures");
|
|
|
|
|
|
File.WriteAllTextAsync(
|
2025-04-11 09:56:06 +08:00
|
|
|
|
$"{artDomainPath}/这里放所有美术的资源,因涉及打包依赖等原因,不建议在上一层节点新增文件夹,如涉及文件夹规范等问题请@张铮.hint", "");
|
|
|
|
|
|
}
|
2025-10-23 09:51:28 +08:00
|
|
|
|
//创建Art 测试场景
|
|
|
|
|
|
/* 2. 再建 Scenes/Test */
|
|
|
|
|
|
string sceneDir = $"{artDomainPath}/Scenes/Test";
|
|
|
|
|
|
if (!Directory.Exists(sceneDir))
|
|
|
|
|
|
{
|
|
|
|
|
|
Directory.CreateDirectory(sceneDir);
|
|
|
|
|
|
/* 3. 创建新场景 */
|
|
|
|
|
|
var newScene = UnityEditor.SceneManagement.EditorSceneManager.NewScene(
|
|
|
|
|
|
UnityEditor.SceneManagement.NewSceneSetup.DefaultGameObjects,
|
|
|
|
|
|
UnityEditor.SceneManagement.NewSceneMode.Single);
|
|
|
|
|
|
|
|
|
|
|
|
/* 4. 删除默认相机(和灯光)*/
|
|
|
|
|
|
foreach (var go in newScene.GetRootGameObjects())
|
|
|
|
|
|
{
|
|
|
|
|
|
if (go.name == "Main Camera" || go.name == "Directional Light")
|
|
|
|
|
|
GameObject.DestroyImmediate(go);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* 5. 载入并实例化 RKCameraRig.prefab */
|
|
|
|
|
|
string prefabPath = "Prefabs/BaseSetting/RKCameraRig";
|
|
|
|
|
|
|
|
|
|
|
|
var prefab = Resources.Load<GameObject>(prefabPath);
|
|
|
|
|
|
var spawned = (GameObject)PrefabUtility.InstantiatePrefab(prefab);
|
|
|
|
|
|
spawned.name = "RKCameraRig";
|
|
|
|
|
|
|
|
|
|
|
|
/* 6. 保存场景 */
|
|
|
|
|
|
string scenePath = Path.Combine("Assets/Art", name, "Scenes", "Test", "TestScene.unity");
|
|
|
|
|
|
UnityEditor.SceneManagement.EditorSceneManager.SaveScene(newScene, scenePath);
|
|
|
|
|
|
}
|
2025-04-11 09:56:06 +08:00
|
|
|
|
|
|
|
|
|
|
|
2025-03-31 11:16:52 +08:00
|
|
|
|
string domainPath = $"{Application.dataPath}/Domain/{domain}";
|
2025-04-11 09:56:06 +08:00
|
|
|
|
if (Directory.Exists(domainPath + "/AddressableRes/Config/DomainConfig.asset"))
|
2025-03-31 11:16:52 +08:00
|
|
|
|
{
|
|
|
|
|
|
EditorUtility.DisplayDialog("错误!", $"\"{domain}\"已经存在,无法创建", "确定");
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-04-16 18:20:46 +08:00
|
|
|
|
CreatDirectory(domainPath);
|
2025-03-31 11:16:52 +08:00
|
|
|
|
|
2025-04-11 09:56:06 +08:00
|
|
|
|
//程序资源存放文件夹
|
2025-03-31 11:16:52 +08:00
|
|
|
|
string resPath = $"{domainPath}/AddressableRes";
|
2025-04-16 18:20:46 +08:00
|
|
|
|
CreatDirectory(resPath);
|
2025-03-31 11:16:52 +08:00
|
|
|
|
//创建音频文件夹
|
2025-04-16 18:20:46 +08:00
|
|
|
|
CreatDirectory(resPath + "/Audios");
|
2025-03-31 11:16:52 +08:00
|
|
|
|
//创建Config文件夹
|
2025-04-16 18:20:46 +08:00
|
|
|
|
CreatDirectory(resPath + "/Config");
|
2025-03-31 11:16:52 +08:00
|
|
|
|
//创建Dll文件夹
|
2025-04-16 18:20:46 +08:00
|
|
|
|
CreatDirectory(resPath + "/Dll");
|
2025-03-31 11:16:52 +08:00
|
|
|
|
//创建Prefabs文件夹
|
2025-04-16 18:20:46 +08:00
|
|
|
|
CreatDirectory(resPath + "/Prefabs");
|
2025-03-31 11:16:52 +08:00
|
|
|
|
//创建Scenes文件夹
|
2025-04-16 18:20:46 +08:00
|
|
|
|
CreatDirectory(resPath + "/Scenes");
|
2025-03-31 11:16:52 +08:00
|
|
|
|
//创建SpriteAtlas文件夹
|
2025-04-16 18:20:46 +08:00
|
|
|
|
CreatDirectory(resPath + "/SpriteAtlas");
|
2025-03-31 11:16:52 +08:00
|
|
|
|
//创建Sprites文件夹
|
2025-04-16 18:20:46 +08:00
|
|
|
|
CreatDirectory(resPath + "/Sprites");
|
2025-03-31 11:16:52 +08:00
|
|
|
|
//创建Video文件夹
|
2025-04-16 18:20:46 +08:00
|
|
|
|
CreatDirectory(resPath + "/Video");
|
2025-03-31 11:16:52 +08:00
|
|
|
|
|
2025-04-16 18:20:46 +08:00
|
|
|
|
File.WriteAllTextAsync($"{resPath}/这里放所有参与热更的资源.hint", "");
|
2025-03-31 11:16:52 +08:00
|
|
|
|
|
|
|
|
|
|
//主入口预制件
|
|
|
|
|
|
GameObject gameObj = new GameObject(domain);
|
|
|
|
|
|
gameObj.transform.position = Vector3.zero;
|
|
|
|
|
|
gameObj.transform.rotation = Quaternion.identity;
|
|
|
|
|
|
gameObj.name = domain;
|
2025-09-04 11:43:35 +08:00
|
|
|
|
|
2025-07-02 16:28:08 +08:00
|
|
|
|
|
|
|
|
|
|
|
2025-04-16 18:20:46 +08:00
|
|
|
|
CreatDirectory($"{resPath}/Prefabs");
|
2025-03-31 11:16:52 +08:00
|
|
|
|
string rootPfbFilePath = $"Assets/Domain/{domain}/AddressableRes/Prefabs/{domain}.prefab";
|
|
|
|
|
|
var localPath = AssetDatabase.GenerateUniqueAssetPath(rootPfbFilePath);
|
|
|
|
|
|
PrefabUtility.SaveAsPrefabAsset(gameObj, localPath);
|
|
|
|
|
|
|
|
|
|
|
|
//存放脚本文件夹
|
|
|
|
|
|
string scriptsPath = $"{domainPath}/HotUpdate";
|
2025-04-16 18:20:46 +08:00
|
|
|
|
CreatDirectory(scriptsPath);
|
|
|
|
|
|
File.WriteAllTextAsync($"{scriptsPath}/这里放所有参与热更的脚本文件.hint", "该文件夹中的程序集定义文件,请勿删除,非常重要。");
|
2025-03-31 11:16:52 +08:00
|
|
|
|
|
|
|
|
|
|
//创建配置文件夹
|
|
|
|
|
|
string confPath = $"{domainPath}/Conf";
|
2025-04-16 18:20:46 +08:00
|
|
|
|
CreatDirectory(confPath);
|
2025-03-31 11:16:52 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//程序集配置资源
|
|
|
|
|
|
|
|
|
|
|
|
string hotfixDomain = $"HotUpdate_{domain}";
|
|
|
|
|
|
|
|
|
|
|
|
string hotfixDomainAsmdef = $"{scriptsPath}/{hotfixDomain}.asmdef";
|
|
|
|
|
|
await using (var writer = new StreamWriter(hotfixDomainAsmdef))
|
|
|
|
|
|
{
|
|
|
|
|
|
string body = Resources.Load<TextAsset>("AssemblyDefinitionTemplate").text;
|
|
|
|
|
|
body = body.Replace("MODULE_IDENT", hotfixDomain);
|
|
|
|
|
|
body = body.Replace("ROOT_NAMESPACE", hotfixDomain);
|
|
|
|
|
|
await writer.WriteAsync(body);
|
|
|
|
|
|
}
|
2025-07-02 16:28:08 +08:00
|
|
|
|
|
2025-03-31 11:16:52 +08:00
|
|
|
|
//模块化脚本生成配置
|
|
|
|
|
|
string domainClassName = $"{domain}Domain";
|
|
|
|
|
|
string architectureClassName = $"{domain}Architecture";
|
2025-07-02 16:28:08 +08:00
|
|
|
|
#if HotUpdate
|
2025-03-31 11:16:52 +08:00
|
|
|
|
//模块配置资源
|
|
|
|
|
|
DomainConfig moduleConfig = CreateInstance<DomainConfig>();
|
|
|
|
|
|
moduleConfig.domain = domain;
|
|
|
|
|
|
moduleConfig.className = domainClassName;
|
|
|
|
|
|
moduleConfig.mainPrefab = "Prefabs_" + gameObj.name;
|
|
|
|
|
|
moduleConfig.@namespace = domain;
|
|
|
|
|
|
AssetDatabase.CreateAsset(moduleConfig, $"Assets/Domain/{domain}/AddressableRes/Config/DomainConfig.asset");
|
|
|
|
|
|
//
|
2025-07-02 16:28:08 +08:00
|
|
|
|
|
2025-03-31 11:16:52 +08:00
|
|
|
|
|
|
|
|
|
|
//编辑器配置资源
|
|
|
|
|
|
BuildAssetDataSetting buildAssetDataSetting = CreateInstance<BuildAssetDataSetting>();
|
|
|
|
|
|
buildAssetDataSetting.packageName = domain;
|
|
|
|
|
|
AssetDatabase.CreateAsset(buildAssetDataSetting,
|
|
|
|
|
|
$"Assets/Domain/{domain}/Conf/BuildAssetDataSetting.asset");
|
|
|
|
|
|
|
|
|
|
|
|
AssetDatabase.Refresh();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
string configPath = $"Assets/Domain/{domain}/HotUpdate/{hotfixDomain}.asmdef";
|
|
|
|
|
|
AssemblyDefinitionAsset assemblyDefinitionAsset =
|
|
|
|
|
|
AssetDatabase.LoadAssetAtPath<AssemblyDefinitionAsset>(configPath);
|
2025-04-11 09:56:06 +08:00
|
|
|
|
if (domain != "Main")
|
2025-03-31 11:16:52 +08:00
|
|
|
|
{
|
2025-07-02 16:28:08 +08:00
|
|
|
|
|
2025-04-11 09:56:06 +08:00
|
|
|
|
// 将程序集定义添加到 HybridCLR 热更列表
|
|
|
|
|
|
var settings = SettingsUtil.HybridCLRSettings;
|
|
|
|
|
|
if (!settings.hotUpdateAssemblyDefinitions.Contains(assemblyDefinitionAsset))
|
|
|
|
|
|
{
|
|
|
|
|
|
var assemblyList = settings.hotUpdateAssemblyDefinitions.ToList();
|
|
|
|
|
|
assemblyList.Add(assemblyDefinitionAsset);
|
|
|
|
|
|
SettingsUtil.HybridCLRSettings.hotUpdateAssemblyDefinitions = assemblyList.ToArray();
|
|
|
|
|
|
}
|
2025-03-31 11:16:52 +08:00
|
|
|
|
|
2025-04-11 09:56:06 +08:00
|
|
|
|
|
|
|
|
|
|
List<AssemblyDefinitionAsset> assemblies = new List<AssemblyDefinitionAsset>();
|
|
|
|
|
|
for (int i = 0; i < settings.hotUpdateAssemblyDefinitions.Length; i++)
|
2025-03-31 11:16:52 +08:00
|
|
|
|
{
|
2025-04-11 09:56:06 +08:00
|
|
|
|
if (settings.hotUpdateAssemblyDefinitions[i] != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
assemblies.Add(settings.hotUpdateAssemblyDefinitions[i]);
|
|
|
|
|
|
}
|
2025-03-31 11:16:52 +08:00
|
|
|
|
}
|
2025-04-11 09:56:06 +08:00
|
|
|
|
|
|
|
|
|
|
HybridCLRSettings.Instance.hotUpdateAssemblyDefinitions = assemblies.ToArray();
|
|
|
|
|
|
HybridCLRSettings.Save();
|
2025-03-31 11:16:52 +08:00
|
|
|
|
|
2025-07-02 16:28:08 +08:00
|
|
|
|
}
|
|
|
|
|
|
#endif
|
2025-03-31 11:16:52 +08:00
|
|
|
|
AssetDatabase.SaveAssets();
|
2025-04-11 09:56:06 +08:00
|
|
|
|
|
|
|
|
|
|
|
2025-03-31 11:16:52 +08:00
|
|
|
|
string domainClassPath = $"{scriptsPath}/{domainClassName}.cs";
|
|
|
|
|
|
//await File.WriteAllTextAsync($"{scriptsPath}/{domainClassName}.cs", domainTemplate);
|
|
|
|
|
|
await using (var writer = new StreamWriter(domainClassPath))
|
|
|
|
|
|
{
|
|
|
|
|
|
string domainTemplate = Resources.Load<TextAsset>("DomainTemplate").text;
|
|
|
|
|
|
domainTemplate = domainTemplate.Replace("ClassNameXX", domainClassName)
|
|
|
|
|
|
.Replace("ReturnArchitecture", architectureClassName)
|
|
|
|
|
|
.Replace("ArchitectureX", architectureClassName)
|
2025-04-11 09:56:06 +08:00
|
|
|
|
.Replace("NamespaceX", domain)
|
|
|
|
|
|
.Replace("DomainNameXX", domain);
|
2025-03-31 11:16:52 +08:00
|
|
|
|
await writer.WriteAsync(domainTemplate);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-09-30 15:55:11 +08:00
|
|
|
|
[TitleGroup("预览Domain作用域")]
|
|
|
|
|
|
[ListDrawerSettings(DraggableItems = false, ShowFoldout = false, ShowPaging = false, ShowItemCount = false,
|
|
|
|
|
|
HideRemoveButton = true,HideAddButton = true)]
|
|
|
|
|
|
public List<CreatDomainEntity> domainList;
|
2025-03-31 11:16:52 +08:00
|
|
|
|
|
|
|
|
|
|
protected override void Initialize()
|
|
|
|
|
|
{
|
|
|
|
|
|
base.Initialize();
|
|
|
|
|
|
domainList = GetCreatDomainAll();
|
|
|
|
|
|
}
|
2025-04-11 09:56:06 +08:00
|
|
|
|
|
2025-03-31 11:16:52 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 获取全部作用域
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public static string[] GetCreatDomainAllName()
|
|
|
|
|
|
{
|
|
|
|
|
|
string domainPath = $"{Application.dataPath}/Domain";
|
|
|
|
|
|
string[] domains;
|
|
|
|
|
|
// 新增目录获取代码
|
|
|
|
|
|
if (Directory.Exists(domainPath))
|
|
|
|
|
|
{
|
|
|
|
|
|
var dirInfo = new DirectoryInfo(domainPath);
|
|
|
|
|
|
// 获取直接子目录(不递归)
|
|
|
|
|
|
domains = dirInfo.GetDirectories("*", SearchOption.TopDirectoryOnly)
|
|
|
|
|
|
.Select(d => d.Name)
|
|
|
|
|
|
.ToArray();
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
domains = Array.Empty<string>();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return domains;
|
|
|
|
|
|
}
|
2025-04-11 09:56:06 +08:00
|
|
|
|
|
2025-03-31 11:16:52 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 获取全部作用域
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public static List<CreatDomainEntity> GetCreatDomainAll()
|
|
|
|
|
|
{
|
|
|
|
|
|
string domainPath = $"{Application.dataPath}/Domain";
|
|
|
|
|
|
string[] domains;
|
|
|
|
|
|
// 新增目录获取代码
|
|
|
|
|
|
if (Directory.Exists(domainPath))
|
|
|
|
|
|
{
|
|
|
|
|
|
var dirInfo = new DirectoryInfo(domainPath);
|
|
|
|
|
|
// 获取直接子目录(不递归)
|
|
|
|
|
|
domains = dirInfo.GetDirectories("*", SearchOption.TopDirectoryOnly)
|
|
|
|
|
|
.Select(d => d.Name)
|
|
|
|
|
|
.ToArray();
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
domains = Array.Empty<string>();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
List<CreatDomainEntity> domainList = new List<CreatDomainEntity>();
|
|
|
|
|
|
foreach (var item in domains)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (File.Exists($"{domainPath}/{item}/AddressableRes/Config/DomainConfig.asset"))
|
|
|
|
|
|
{
|
|
|
|
|
|
CreatDomainEntity domainEntity = new CreatDomainEntity(domainList)
|
|
|
|
|
|
{
|
|
|
|
|
|
DomainName = item,
|
|
|
|
|
|
domainPath = $"{domainPath}/{item}"
|
|
|
|
|
|
};
|
|
|
|
|
|
domainList.Add(domainEntity);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return domainList;
|
|
|
|
|
|
}
|
2025-04-16 18:20:46 +08:00
|
|
|
|
|
|
|
|
|
|
private static void CreatDirectory(string artDomainPath)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (!Directory.Exists(artDomainPath))
|
|
|
|
|
|
{
|
|
|
|
|
|
//创建Animation文件夹
|
|
|
|
|
|
Directory.CreateDirectory(artDomainPath);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static void CreateDomainDirectory(string domain)
|
|
|
|
|
|
{
|
|
|
|
|
|
string artDomainPath = $"{Application.dataPath}/Art/{domain}";
|
|
|
|
|
|
//创建Animation文件夹
|
|
|
|
|
|
CreatDirectory(artDomainPath + "/Animation");
|
|
|
|
|
|
//创建Effects文件夹
|
|
|
|
|
|
CreatDirectory(artDomainPath + "/Effects");
|
|
|
|
|
|
//创建Fbx文件夹
|
|
|
|
|
|
CreatDirectory(artDomainPath + "/Fbx");
|
|
|
|
|
|
//创建Font文件夹
|
|
|
|
|
|
CreatDirectory(artDomainPath + "/Font");
|
|
|
|
|
|
//创建Materials文件夹
|
|
|
|
|
|
CreatDirectory(artDomainPath + "/Materials");
|
|
|
|
|
|
//创建Prefabs文件夹
|
|
|
|
|
|
CreatDirectory(artDomainPath + "/Prefabs");
|
|
|
|
|
|
//创建Scenes文件夹
|
|
|
|
|
|
CreatDirectory(artDomainPath + "/Scenes");
|
|
|
|
|
|
//创建/Scenes/Test文件夹
|
|
|
|
|
|
CreatDirectory(artDomainPath + "/Scenes/Test");
|
|
|
|
|
|
//创建Shader文件夹
|
|
|
|
|
|
CreatDirectory(artDomainPath + "/Shader");
|
|
|
|
|
|
//创建Textures文件夹
|
|
|
|
|
|
CreatDirectory(artDomainPath + "/Textures");
|
2025-07-02 16:28:08 +08:00
|
|
|
|
|
2025-04-16 18:20:46 +08:00
|
|
|
|
string domainPath = $"{Application.dataPath}/Domain/{domain}";
|
|
|
|
|
|
//程序资源存放文件夹
|
|
|
|
|
|
string resPath = $"{domainPath}/AddressableRes";
|
|
|
|
|
|
CreatDirectory(resPath);
|
|
|
|
|
|
//创建音频文件夹
|
|
|
|
|
|
CreatDirectory(resPath + "/Audios");
|
|
|
|
|
|
//创建Config文件夹
|
|
|
|
|
|
CreatDirectory(resPath + "/Config");
|
|
|
|
|
|
//创建Dll文件夹
|
|
|
|
|
|
CreatDirectory(resPath + "/Dll");
|
|
|
|
|
|
//创建Prefabs文件夹
|
|
|
|
|
|
CreatDirectory(resPath + "/Prefabs");
|
|
|
|
|
|
//创建Scenes文件夹
|
|
|
|
|
|
CreatDirectory(resPath + "/Scenes");
|
|
|
|
|
|
//创建SpriteAtlas文件夹
|
|
|
|
|
|
CreatDirectory(resPath + "/SpriteAtlas");
|
|
|
|
|
|
//创建Sprites文件夹
|
|
|
|
|
|
CreatDirectory(resPath + "/Sprites");
|
|
|
|
|
|
//创建Video文件夹
|
|
|
|
|
|
CreatDirectory(resPath + "/Video");
|
2025-07-02 16:28:08 +08:00
|
|
|
|
|
2025-04-16 18:20:46 +08:00
|
|
|
|
AssetDatabase.Refresh();
|
|
|
|
|
|
}
|
2025-03-31 11:16:52 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|