한글 깨지는거 수정

This commit is contained in:
2026-07-07 14:28:54 +09:00
parent acc55b09d3
commit 86a0f2c8eb
4 changed files with 30 additions and 21 deletions

View File

@@ -1,4 +1,4 @@
using System.Text;
using System.Text;
using UnityEngine;
public class StoryComputerSystem : MonoBehaviour
@@ -16,8 +16,8 @@ public void TogglePower()
isPowerOn = !isPowerOn;
Debug.Log(isPowerOn
? "[StoryComputer] 컴퓨터 전원이 켜졌습니다."
: "[StoryComputer] 컴퓨터 전원이 꺼졌습니다.");
? "[StoryComputer] 컴퓨터 전원이 켜졌습니다."
: "[StoryComputer] 컴퓨터 전원이 꺼졌습니다.");
if (isPowerOn)
{
@@ -30,7 +30,7 @@ public void SaveFromComputer()
if (!CanUseComputer()) return;
StoryManager.Instance.Save();
Debug.Log("[StoryComputer] 현재 스토리 상태를 저장했습니다.");
Debug.Log("[StoryComputer] 현재 스토리 상태를 저장했습니다.");
}
public void LoadFromComputer()
@@ -41,12 +41,12 @@ public void LoadFromComputer()
if (success)
{
Debug.Log("[StoryComputer] 저장된 스토리 상태를 불러왔습니다.");
Debug.Log("[StoryComputer] 저장된 스토리 상태를 불러왔습니다.");
PrintCurrentState();
}
else
{
Debug.LogWarning("[StoryComputer] 불러올 저장 파일이 없습니다.");
Debug.LogWarning("[StoryComputer] 불러올 저장 파일이 없습니다.");
}
}
@@ -55,7 +55,7 @@ public void ResetStoryFromComputer()
if (!CanUseComputer()) return;
StoryManager.Instance.ResetAll();
Debug.Log("[StoryComputer] 스토리 상태를 초기화했습니다.");
Debug.Log("[StoryComputer] 스토리 상태를 초기화했습니다.");
PrintCurrentState();
}
@@ -63,21 +63,21 @@ public void PrintCurrentState()
{
if (StoryManager.Instance == null)
{
Debug.LogWarning("[StoryComputer] StoryManager가 없습니다.");
Debug.LogWarning("[StoryComputer] StoryManager가 없습니다.");
return;
}
StringBuilder sb = new StringBuilder();
sb.AppendLine("========== 현재 스토리 상태 ==========");
sb.AppendLine($"메인 진행도: {StoryManager.Instance.MainProgress}");
sb.AppendLine("========== 현재 스토리 상태 ==========");
sb.AppendLine($"메인 진행도: {StoryManager.Instance.MainProgress}");
sb.AppendLine();
sb.AppendLine("공룡별 호감도:");
sb.AppendLine("공룡별 호감도:");
if (characters == null || characters.Length == 0)
{
sb.AppendLine("- 등록된 캐릭터 없음");
sb.AppendLine("- 등록된 캐릭터 없음");
}
else
{
@@ -99,13 +99,13 @@ private bool CanUseComputer()
{
if (!isPowerOn)
{
Debug.LogWarning("[StoryComputer] 컴퓨터 전원이 꺼져 있어서 사용할 수 없습니다.");
Debug.LogWarning("[StoryComputer] 컴퓨터 전원이 꺼져 있어서 사용할 수 없습니다.");
return false;
}
if (StoryManager.Instance == null)
{
Debug.LogWarning("[StoryComputer] StoryManager가 씬에 없습니다.");
Debug.LogWarning("[StoryComputer] StoryManager가 씬에 없습니다.");
return false;
}

View File

@@ -78,15 +78,18 @@ public void RecordChoice(string code)
// 이어하기를 만들 때 타이틀 화면 등에서 Load()를 호출하면 된다.
private static string SavePath => Path.Combine(Application.persistentDataPath, "story_state.json");
public void Save() => File.WriteAllText(SavePath, _state.ToJson());
public void CallLoad() => Load();
// 저장 파일이 있으면 불러온다. 성공 여부 반환.
public void Load()
public bool Load()
{
if (!File.Exists(SavePath))
{
Debug.LogWarning("세이브 파일이 없습니다.");
return;
return false;
}
try
@@ -95,17 +98,17 @@ public void Load()
if (loaded == null)
{
Debug.LogWarning("세이브 파일이 잘못되었습니다.");
return;
return false;
}
_state = loaded;
Changed?.Invoke();
return;
return true;
}
catch (Exception e)
{
Debug.LogWarning($"[StoryManager] 저장 파일 로드 실패: {e.Message}");
return;
return false;
}
}