00 1.0.11更新

This commit is contained in:
2025-04-14 14:40:32 +08:00
parent c0b38b6524
commit 902c7b1c5f
5 changed files with 61 additions and 16 deletions

View File

@@ -14,18 +14,7 @@ namespace Stary.Evo
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)

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: f1b6f2585f9e4815aa16759ec152b390
timeCreated: 1744611618

View File

@@ -0,0 +1,40 @@
using System.Collections.Generic;
using Stary.Evo.Editor;
using UnityEditor;
using UnityEngine;
namespace Stary.Evo
{
[CustomEditor(typeof(MainDomainAll))]
public class MainDomainAllEditor : UnityEditor.Editor
{
public override void OnInspectorGUI()
{
base.OnInspectorGUI();
if (GUILayout.Button("生成点位集合数据"))
{
var domainAll = CreatAssetWindow.GetCreatDomainAll();
List<VideoDomainEntity> videoDomainEntities = new List<VideoDomainEntity>();
for (int i = 0; i < domainAll.Count; i++)
{
if (domainAll[i].DomainName != "Main")
videoDomainEntities.Add(new VideoDomainEntity()
{
domainName = domainAll[i].DomainName,
});
}
// string configPath = $"Assets/Main/Resources/MainDomainAll.asset";
// MainDomainAll targetComponent =
// AssetDatabase.LoadAssetAtPath<MainDomainAll>(configPath);
var targetComponent = target as MainDomainAll;
if (targetComponent != null)
{
targetComponent.domainAll = videoDomainEntities.ToArray();
}
EditorUtility.SetDirty(targetComponent);
AssetDatabase.SaveAssets();
}
}
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: a9f7b7d280094f2e8f6aed8be7314b75
timeCreated: 1744611639

View File

@@ -1,15 +1,25 @@
using System;
using System.Collections.Generic;
using Sirenix.OdinInspector;
using UnityEditor;
using UnityEngine;
using UnityEngine.Serialization;
namespace Stary.Evo
{
[CreateAssetMenu(fileName = "MainDomainAll", menuName = "Evo/Create MainDomainAll")]
public class MainDomainAll : ScriptableObject
{
public string[] domainAll;
}
public VideoDomainEntity[] domainAll;
}
[Serializable]
public struct VideoDomainEntity
{
public bool isVideo;
public string domainName;
}
}