Files
plugin-library/Assets/00.StaryEvoTools/Editor/BuildAsset/CreatDomainDirectory.cs
stary 26a2d43c16
Some checks failed
Plugin Library CI / publish (00.ARMazTools) (push) Failing after 3s
Plugin Library CI / publish (00.BuildOriginality) (push) Successful in 4s
Plugin Library CI / publish (00.StaryEvo) (push) Successful in 6s
Plugin Library CI / publish (00.StaryEvoTools) (push) Successful in 19s
Plugin Library CI / publish (01.HybridCLR) (push) Successful in 6s
Plugin Library CI / publish (04.AudioCore) (push) Has been cancelled
Plugin Library CI / publish (05.TableTextConversion) (push) Has been cancelled
Plugin Library CI / publish (06.UIFarme) (push) Has been cancelled
Plugin Library CI / publish (07.RKTools) (push) Has been cancelled
Plugin Library CI / publish (08.UniTask) (push) Has been cancelled
Plugin Library CI / publish (09.CodeChecker) (push) Has been cancelled
Plugin Library CI / publish (10.StoryEditor) (push) Has been cancelled
Plugin Library CI / publish (10.XNode) (push) Has been cancelled
Plugin Library CI / publish (11.PointCloudTools) (push) Has been cancelled
Plugin Library CI / publish (03.YooAsset) (push) Has been cancelled
Plugin Library CI / publish (02.InformationSave) (push) Successful in 3s
【m】更新持久化存储
2026-04-13 21:24:12 +08:00

78 lines
2.6 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using System;
using Stary.Evo.Editor;
using UnityEditor;
using UnityEngine;
namespace Stary.Evo
{
[InitializeOnLoad]
public static class CreatDomainDirectory
{
static CreatDomainDirectory()
{
// 注意 因为这个构造函数会被重复调用,
//所以为了防止quitting和update两个回调被重复添加需要先移除后添加
EditorApplication.quitting -= OnEditorQuit;
EditorApplication.quitting += OnEditorQuit;
if (!CustomEditorPrefs.HasKey("StartUp"))
{
// 通过标记记录是否已经执行过该方法
OnEditorStartUp();
CustomEditorPrefs.SetInt("StartUp", 1);
if (CustomEditorPrefs.GetInt("CreatDomainDirectory") == 0)
{
CustomEditorPrefs.SetInt("CreatDomainDirectory", 1);
bool isOk = EditorUtility.DisplayDialog("提示", "发现目录存在缺失,是否检索并创建缺失目录", "是", "否");
if (isOk)
{
var DomainAll = CreatAssetWindow.GetCreatDomainAll();
foreach (var domain in DomainAll)
{
CreatAssetWindow.CreateDomainDirectory(domain.DomainName);
}
}
}
if (CustomEditorPrefs.GetString("ChangeHotUpdateSchema") == "")
{
ChangeHotUpdateSchema.SetHotUpdateMode(HotUpdateMode.NotUpdate);
}
else
{
ChangeHotUpdateSchema.SetHotUpdateMode(
Enum.Parse<HotUpdateMode>(CustomEditorPrefs.GetString("ChangeHotUpdateSchema")));
}
if (CustomEditorPrefs.GetString("ChangePlayerSchema") == "")
{
ChangePlayerSchema.SetPlayerMode(PLayerMode.EDITOR_SIMULATEMODE);
}
else
{
ChangePlayerSchema.SetPlayerMode(
Enum.Parse<PLayerMode>(CustomEditorPrefs.GetString("ChangePlayerSchema")));
}
}
}
/// <summary>
/// UnityEditor 关闭时取消标记
/// </summary>
private static void OnEditorQuit()
{
CustomEditorPrefs.DeleteKey("StartUp");
}
/// <summary>
/// 只会在UnityEditor启动时执行一次
/// </summary>
static void OnEditorStartUp()
{
Debug.Log(" UnityEditor 启动 ");
}
}
}