【m】build apk 开发

This commit is contained in:
2025-07-02 16:28:08 +08:00
parent ec8b2f7e25
commit 986c610ef2
58 changed files with 1480 additions and 2914 deletions

View File

@@ -2,8 +2,10 @@ using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
#if HotUpdate
using HybridCLR.Editor;
using HybridCLR.Editor.Settings;
#endif
using Sirenix.OdinInspector;
using Sirenix.OdinInspector.Editor;
using Stary.Evo.InformationSave;
@@ -13,7 +15,6 @@ using UnityEngine;
namespace Stary.Evo.Editor
{
public class CreatAssetWindow : OdinEditorWindow
{
[MenuItem("Evo/创建Domain作用域")]
@@ -48,8 +49,8 @@ namespace Stary.Evo.Editor
Directory.CreateDirectory(artDomainPath);
if (!Directory.Exists(artDomainPath))
//创建Animation文件夹
CreatDirectory(artDomainPath + "/Animation");
//创建Animation文件夹
CreatDirectory(artDomainPath + "/Animation");
//创建Effects文件夹
CreatDirectory(artDomainPath + "/Effects");
//创建Fbx文件夹
@@ -115,9 +116,8 @@ namespace Stary.Evo.Editor
transformInfo.transform.position = Vector3.zero;
transformInfo.transform.rotation = Quaternion.identity;
transformInfo.AddComponent<LocalTransformInfo>();
CreatDirectory($"{resPath}/Prefabs");
string rootPfbFilePath = $"Assets/Domain/{domain}/AddressableRes/Prefabs/{domain}.prefab";
var localPath = AssetDatabase.GenerateUniqueAssetPath(rootPfbFilePath);
@@ -145,11 +145,11 @@ namespace Stary.Evo.Editor
body = body.Replace("ROOT_NAMESPACE", hotfixDomain);
await writer.WriteAsync(body);
}
//模块化脚本生成配置
string domainClassName = $"{domain}Domain";
string architectureClassName = $"{domain}Architecture";
#if HotUpdate
//模块配置资源
DomainConfig moduleConfig = CreateInstance<DomainConfig>();
moduleConfig.domain = domain;
@@ -158,7 +158,7 @@ namespace Stary.Evo.Editor
moduleConfig.@namespace = domain;
AssetDatabase.CreateAsset(moduleConfig, $"Assets/Domain/{domain}/AddressableRes/Config/DomainConfig.asset");
//
//编辑器配置资源
BuildAssetDataSetting buildAssetDataSetting = CreateInstance<BuildAssetDataSetting>();
@@ -174,6 +174,7 @@ namespace Stary.Evo.Editor
AssetDatabase.LoadAssetAtPath<AssemblyDefinitionAsset>(configPath);
if (domain != "Main")
{
// 将程序集定义添加到 HybridCLR 热更列表
var settings = SettingsUtil.HybridCLRSettings;
if (!settings.hotUpdateAssemblyDefinitions.Contains(assemblyDefinitionAsset))
@@ -195,8 +196,9 @@ namespace Stary.Evo.Editor
HybridCLRSettings.Instance.hotUpdateAssemblyDefinitions = assemblies.ToArray();
HybridCLRSettings.Save();
}
}
#endif
AssetDatabase.SaveAssets();
@@ -215,7 +217,6 @@ namespace Stary.Evo.Editor
}
[TitleGroup("预览Domain作用域")] public List<CreatDomainEntity> domainList;
protected override void Initialize()
@@ -319,7 +320,7 @@ namespace Stary.Evo.Editor
CreatDirectory(artDomainPath + "/Shader");
//创建Textures文件夹
CreatDirectory(artDomainPath + "/Textures");
string domainPath = $"{Application.dataPath}/Domain/{domain}";
//程序资源存放文件夹
string resPath = $"{domainPath}/AddressableRes";
@@ -340,7 +341,7 @@ namespace Stary.Evo.Editor
CreatDirectory(resPath + "/Sprites");
//创建Video文件夹
CreatDirectory(resPath + "/Video");
AssetDatabase.Refresh();
}
}