[WL-816] 세이브 단일화가 실제로는 동작하지 않던 것 수정 (#816)
816g 가 실측으로 지목: WLIslandSaveSettings.asset 의 m_Script 가 {fileID: 0}
이라 Resources.Load 가 null → 세이브가 여전히 Level01.dat / InGame.dat 로
갈리고 있었다(33afe0b8d 는 코드만 들어가고 설정이 안 붙은 상태였다).
원인: 유니티는 ScriptableObject 를 **클래스 이름과 같은 이름의 .cs 파일**
에서만 MonoScript 로 인식한다. 그 클래스가 WLIslandSave.cs 안에 있어
m_Script 를 바인딩할 수 없었다.
조치: WLIslandSaveSettings.cs 로 분리 + .asset 의 m_Script 를 새 GUID 로.
검증: ResolveSaveName("InGame") = "WL_Island" (런타임 실측) · 컴파일 오류 0.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
parent
1c41891d2c
commit
9aaddae676
|
|
@ -9,9 +9,9 @@ MonoBehaviour:
|
|||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 0}
|
||||
m_Script: {fileID: 11500000, guid: 872d40f4ac576ea4eac94fce5f49fdd8, type: 3}
|
||||
m_Name: WLIslandSaveSettings
|
||||
m_EditorClassIdentifier: Assembly-CSharp:WL.Island:WLIslandSaveSettings
|
||||
m_EditorClassIdentifier:
|
||||
enabled_: 1
|
||||
saveName: WL_Island
|
||||
verboseLog: 0
|
||||
|
|
|
|||
|
|
@ -19,25 +19,9 @@ using UnityEngine;
|
|||
|
||||
namespace WL.Island
|
||||
{
|
||||
public sealed class WLIslandSaveSettings : ScriptableObject
|
||||
{
|
||||
[Tooltip("0 이면 원본 동작(활성 씬 이름)으로 되돌아간다.")]
|
||||
public int enabled_ = 1;
|
||||
|
||||
[Tooltip("모든 경로가 공유할 세이브 파일 이름(확장자 제외).")]
|
||||
public string saveName = "WL_Island";
|
||||
|
||||
[Tooltip("1 이면 해석 결과를 로그로 남긴다.")]
|
||||
public int verboseLog = 0;
|
||||
|
||||
static WLIslandSaveSettings s_cache;
|
||||
|
||||
public static WLIslandSaveSettings Get()
|
||||
{
|
||||
if (s_cache == null) s_cache = Resources.Load<WLIslandSaveSettings>("WL/WLIslandSaveSettings");
|
||||
return s_cache;
|
||||
}
|
||||
}
|
||||
// 🔴 `WLIslandSaveSettings`(ScriptableObject)는 **`WLIslandSaveSettings.cs` 로 분리**했다.
|
||||
// 유니티는 SO 를 클래스 이름과 같은 이름의 .cs 파일에서만 MonoScript 로 인식한다 —
|
||||
// 여기 있던 동안 `.asset` 의 `m_Script` 가 비어 세이브 단일화가 동작하지 않았다(816g 실측).
|
||||
|
||||
public static class WLIslandSave
|
||||
{
|
||||
|
|
|
|||
|
|
@ -0,0 +1,36 @@
|
|||
// ─────────────────────────────────────────────────────────────────────────────
|
||||
// WLIslandSaveSettings.cs — 섬 세이브 이름 고정 설정(SO).
|
||||
//
|
||||
// 🔴 왜 파일을 나눴나 (Lead 실측 · 2026-09-13)
|
||||
// 유니티는 `ScriptableObject` 를 **클래스 이름과 같은 이름의 .cs 파일**에서만
|
||||
// `MonoScript` 로 인식한다. 이 클래스가 `WLIslandSave.cs` 안에 있던 동안에는
|
||||
// `.asset` 의 `m_Script` 가 **`{fileID: 0}`** 로 비어 저장돼
|
||||
// `Resources.Load` 가 null 을 돌려줬고, 그래서 세이브 단일화(main `33afe0b8d`)가
|
||||
// **동작하지 않았다**(816g 가 실측으로 지목: `WL_Island.dat` 가 아니라
|
||||
// `Level01.dat`/`InGame.dat` 가 생김). 파일을 분리해 바로잡는다.
|
||||
// ─────────────────────────────────────────────────────────────────────────────
|
||||
|
||||
using UnityEngine;
|
||||
|
||||
namespace WL.Island
|
||||
{
|
||||
public sealed class WLIslandSaveSettings : ScriptableObject
|
||||
{
|
||||
[Tooltip("0 이면 원본 동작(활성 씬 이름)으로 되돌아간다.")]
|
||||
public int enabled_ = 1;
|
||||
|
||||
[Tooltip("모든 경로가 공유할 세이브 파일 이름(확장자 제외).")]
|
||||
public string saveName = "WL_Island";
|
||||
|
||||
[Tooltip("1 이면 해석 결과를 로그로 남긴다.")]
|
||||
public int verboseLog = 0;
|
||||
|
||||
static WLIslandSaveSettings s_cache;
|
||||
|
||||
public static WLIslandSaveSettings Get()
|
||||
{
|
||||
if (s_cache == null) s_cache = Resources.Load<WLIslandSaveSettings>("WL/WLIslandSaveSettings");
|
||||
return s_cache;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 872d40f4ac576ea4eac94fce5f49fdd8
|
||||
Loading…
Reference in New Issue