00 1.0.11更新
This commit is contained in:
@@ -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)
|
||||
|
||||
3
Assets/00.StaryEvo/Editor/PlayerSettings.meta
Normal file
3
Assets/00.StaryEvo/Editor/PlayerSettings.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f1b6f2585f9e4815aa16759ec152b390
|
||||
timeCreated: 1744611618
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a9f7b7d280094f2e8f6aed8be7314b75
|
||||
timeCreated: 1744611639
|
||||
@@ -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;
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user