fix: Sidekick 에디터 자동 실행 방지
- Sidekick Character Tool과 Downloader가 메뉴 실행 시에만 열리도록 수동 실행 플래그를 추가 - 데이터베이스 초기화 실패 및 로딩 상태 null 참조 방어 처리 추가 - TMP 한글 폰트 에셋의 글리프/문자 테이블 갱신
This commit is contained in:
@@ -25,17 +25,24 @@ namespace Synty.SidekickCharacters
|
||||
private const string _PACKAGE_CACHE = "Assets/DownloadCache/Sidekicks.unitypackage";
|
||||
private const string _DB_PACKAGE_CACHE = "Assets/DownloadCache/SidekicksDatabase.unitypackage";
|
||||
private const string _VERSION_FILE = "Assets/External/Models/SidekickCharacters/Scripts/Editor/version.txt";
|
||||
private const string _VERSION_TAG = "\"tag_name\":";
|
||||
private const string _VERSION_KEY = "sk_current_tool_version";
|
||||
private const string _SIDEKICK_TOOL_MENU_ITEM = "Synty/Sidekick Character Tool";
|
||||
private const string _VERSION_TAG = "\"tag_name\":";
|
||||
private const string _VERSION_KEY = "sk_current_tool_version";
|
||||
private const string _SIDEKICK_TOOL_MENU_ITEM = "Synty/Sidekick Character Tool";
|
||||
private const string _MANUAL_OPEN_SESSION_KEY = "syntySkDownloaderManualOpenRequested";
|
||||
|
||||
private string _version = "-";
|
||||
private Label _latestVersion;
|
||||
|
||||
public void Awake()
|
||||
{
|
||||
BackgroundUpdateCheck();
|
||||
}
|
||||
public void Awake()
|
||||
{
|
||||
if (!SessionState.GetBool(_MANUAL_OPEN_SESSION_KEY, false))
|
||||
{
|
||||
Close();
|
||||
return;
|
||||
}
|
||||
|
||||
BackgroundUpdateCheck();
|
||||
}
|
||||
|
||||
public void CreateGUI()
|
||||
{
|
||||
@@ -287,23 +294,18 @@ namespace Synty.SidekickCharacters
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates an instance of the Downloader Tool, to allow checks for new versions on editor startup.
|
||||
/// </summary>
|
||||
[InitializeOnLoad]
|
||||
public static class DownloaderBackgroundService
|
||||
{
|
||||
private static ToolDownloader _instance;
|
||||
|
||||
static DownloaderBackgroundService()
|
||||
{
|
||||
EditorApplication.update += CreateToolInstance;
|
||||
}
|
||||
|
||||
static void CreateToolInstance()
|
||||
{
|
||||
EditorApplication.update -= CreateToolInstance;
|
||||
EditorWindow[] allWindows = Resources.FindObjectsOfTypeAll<EditorWindow>();
|
||||
/// <summary>
|
||||
/// 메뉴에서 요청한 경우에만 다운로더 도구를 생성하고 연다.
|
||||
/// </summary>
|
||||
public static class DownloaderBackgroundService
|
||||
{
|
||||
private const string _MANUAL_OPEN_SESSION_KEY = "syntySkDownloaderManualOpenRequested";
|
||||
|
||||
private static ToolDownloader _instance;
|
||||
|
||||
static void CreateToolInstance()
|
||||
{
|
||||
EditorWindow[] allWindows = Resources.FindObjectsOfTypeAll<EditorWindow>();
|
||||
|
||||
// Filter the windows to find the one with the desired type name
|
||||
EditorWindow foundWindow = allWindows.FirstOrDefault(window => window.GetType().Name == "ToolDownloader");
|
||||
@@ -340,12 +342,13 @@ namespace Synty.SidekickCharacters
|
||||
_instance.Show();
|
||||
}
|
||||
|
||||
[MenuItem("Synty/Sidekick Tool Downloader")]
|
||||
public static void ShowToolDownloaderWindow()
|
||||
{
|
||||
if (_instance == null)
|
||||
{
|
||||
CreateToolInstance();
|
||||
[MenuItem("Synty/Sidekick Tool Downloader")]
|
||||
public static void ShowToolDownloaderWindow()
|
||||
{
|
||||
SessionState.SetBool(_MANUAL_OPEN_SESSION_KEY, true);
|
||||
if (_instance == null)
|
||||
{
|
||||
CreateToolInstance();
|
||||
}
|
||||
|
||||
_instance.Show();
|
||||
|
||||
Reference in New Issue
Block a user