증거품 UI
This commit is contained in:
@@ -11,6 +11,7 @@ public class StoryState
|
||||
public readonly HashSet<string> CompletedDialogs = new(); // 완료한 DialogGroup 이름
|
||||
public readonly HashSet<string> ChosenCodes = new(); // 골랐던 선택지 Code
|
||||
public readonly HashSet<string> Triggers = new(); // 켜진 트리거 Id (대화 조건 검사용)
|
||||
public readonly List<string> Items = new(); // 가진 아이템 Id (획득 순서 유지 — 증거품창 표시 순서)
|
||||
|
||||
public void Clear()
|
||||
{
|
||||
@@ -19,6 +20,7 @@ public void Clear()
|
||||
CompletedDialogs.Clear();
|
||||
ChosenCodes.Clear();
|
||||
Triggers.Clear();
|
||||
Items.Clear();
|
||||
}
|
||||
|
||||
// ── JSON 변환 ────────────────────────────────────────────────
|
||||
@@ -32,6 +34,7 @@ private class JsonData
|
||||
public List<string> CompletedDialogs = new();
|
||||
public List<string> ChosenCodes = new();
|
||||
public List<string> Triggers = new();
|
||||
public List<string> Items = new();
|
||||
}
|
||||
|
||||
public string ToJson()
|
||||
@@ -45,6 +48,7 @@ public string ToJson()
|
||||
data.CompletedDialogs.AddRange(CompletedDialogs);
|
||||
data.ChosenCodes.AddRange(ChosenCodes);
|
||||
data.Triggers.AddRange(Triggers);
|
||||
data.Items.AddRange(Items);
|
||||
return JsonUtility.ToJson(data, prettyPrint: true);
|
||||
}
|
||||
|
||||
@@ -60,6 +64,7 @@ public static StoryState FromJson(string json)
|
||||
state.CompletedDialogs.UnionWith(data.CompletedDialogs);
|
||||
state.ChosenCodes.UnionWith(data.ChosenCodes);
|
||||
state.Triggers.UnionWith(data.Triggers ?? new List<string>());
|
||||
state.Items.AddRange(data.Items ?? new List<string>());
|
||||
return state;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user