fix: Sidekick 에디터 자동 실행 방지
- Sidekick Character Tool과 Downloader가 메뉴 실행 시에만 열리도록 수동 실행 플래그를 추가 - 데이터베이스 초기화 실패 및 로딩 상태 null 참조 방어 처리 추가 - TMP 한글 폰트 에셋의 글리프/문자 테이블 갱신
This commit is contained in:
@@ -12,38 +12,11 @@ using UnityEngine;
|
||||
|
||||
namespace Synty.SidekickCharacters.UI
|
||||
{
|
||||
[InitializeOnLoad]
|
||||
public static class MenuBootstrapController
|
||||
{
|
||||
private const string _AUTO_OPEN_STATE = "syntySkAutoOpenState";
|
||||
private const string _PREFS_CHECK_NAME = "syntySKCheckDependencies";
|
||||
private const string _MANUAL_OPEN_SESSION_KEY = "syntySkManualOpenRequested";
|
||||
|
||||
private static ModularCharacterWindow _sidekickCharacterWindow;
|
||||
private static bool _openWindowOnStart = true;
|
||||
|
||||
static MenuBootstrapController()
|
||||
{
|
||||
EditorApplication.update += OpenWindowOnStartup;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Opens the Character Creator window when Unity starts or the plugin is added to a project.
|
||||
/// </summary>
|
||||
private static void OpenWindowOnStartup()
|
||||
{
|
||||
_openWindowOnStart = EditorPrefs.GetBool(_AUTO_OPEN_STATE, true);
|
||||
EditorApplication.update -= OpenWindowOnStartup;
|
||||
if (_openWindowOnStart)
|
||||
{
|
||||
if (!SessionState.GetBool("FirstInitDone", false))
|
||||
{
|
||||
ShowSidekickCharacterWindow();
|
||||
|
||||
SessionState.SetBool("FirstInitDone", true);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates the Sidekick Character Creator window and adds it to the toolbar.
|
||||
@@ -51,6 +24,7 @@ namespace Synty.SidekickCharacters.UI
|
||||
[MenuItem("Synty/Sidekick Character Tool")]
|
||||
public static void ShowSidekickCharacterWindow()
|
||||
{
|
||||
SessionState.SetBool(_MANUAL_OPEN_SESSION_KEY, true);
|
||||
FindSidekickCharacterWindow();
|
||||
_sidekickCharacterWindow.Show();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user