新增domain注册脚本
This commit is contained in:
3
Assets/00.StaryEvo/Editor/Build.meta
Normal file
3
Assets/00.StaryEvo/Editor/Build.meta
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 357613ee582c4e068ea5e61e4f6499e4
|
||||||
|
timeCreated: 1744603673
|
||||||
36
Assets/00.StaryEvo/Editor/Build/BuildReport.cs
Normal file
36
Assets/00.StaryEvo/Editor/Build/BuildReport.cs
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
using Stary.Evo.Editor;
|
||||||
|
using UnityEditor;
|
||||||
|
using UnityEditor.Build;
|
||||||
|
using UnityEditor.Callbacks;
|
||||||
|
|
||||||
|
namespace Stary.Evo
|
||||||
|
{
|
||||||
|
// 实现接口的方式
|
||||||
|
public class BuildReport : IPostprocessBuildWithReport, IPreprocessBuildWithReport
|
||||||
|
{
|
||||||
|
public int callbackOrder { get; set; }
|
||||||
|
|
||||||
|
public void OnPreprocessBuild(UnityEditor.Build.Reporting.BuildReport report)
|
||||||
|
{
|
||||||
|
// build前
|
||||||
|
var domainAll = CreatAssetWindow.GetCreatDomainAll();
|
||||||
|
List<string> domainNames = new List<string>();
|
||||||
|
for (int i = 0; i < domainAll.Count; i++)
|
||||||
|
{
|
||||||
|
if (domainAll[i].DomainName != "Main")
|
||||||
|
domainNames.Add(domainAll[i].DomainName);
|
||||||
|
}
|
||||||
|
string configPath = $"Assets/Main/Resources/MainDomainAll.asset";
|
||||||
|
MainDomainAll mainDomainAll =
|
||||||
|
AssetDatabase.LoadAssetAtPath<MainDomainAll>(configPath);
|
||||||
|
mainDomainAll.domainAll = domainNames.ToArray();
|
||||||
|
AssetDatabase.SaveAssets();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnPostprocessBuild(UnityEditor.Build.Reporting.BuildReport report)
|
||||||
|
{
|
||||||
|
// build完成后
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
3
Assets/00.StaryEvo/Editor/Build/BuildReport.cs.meta
Normal file
3
Assets/00.StaryEvo/Editor/Build/BuildReport.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: a96d44b788304391b0e9ba8ff6a7bcc9
|
||||||
|
timeCreated: 1744603665
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "com.staryevo.main",
|
"name": "com.staryevo.main",
|
||||||
"version": "1.0.9",
|
"version": "1.0.10",
|
||||||
"displayName": "00.StaryEvo",
|
"displayName": "00.StaryEvo",
|
||||||
"description": "This is an Framework package",
|
"description": "This is an Framework package",
|
||||||
"unity": "2021.3",
|
"unity": "2021.3",
|
||||||
|
|||||||
Reference in New Issue
Block a user