Merge branch 'main' of https://www.nakjungit.site/sharedacc520k/Dino_Love_Simulation
# Conflicts: # Assets/01_Scenes/_TestScenes/Test1.unity # Assets/XR/Settings/OpenXRPackageSettings.asset
This commit is contained in:
6
.vsconfig
Normal file
6
.vsconfig
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"version": "1.0",
|
||||
"components": [
|
||||
"Microsoft.VisualStudio.Workload.ManagedGame"
|
||||
]
|
||||
}
|
||||
Binary file not shown.
144
Assets/02_Scripts/Managers/StoryComputerSystem.cs
Normal file
144
Assets/02_Scripts/Managers/StoryComputerSystem.cs
Normal file
@@ -0,0 +1,144 @@
|
||||
using System.Text;
|
||||
using UnityEngine;
|
||||
|
||||
public class StoryComputerSystem : MonoBehaviour
|
||||
{
|
||||
[Header("Computer State")]
|
||||
[SerializeField] private bool isPowerOn = false;
|
||||
|
||||
[Header("Affection Check Characters")]
|
||||
[SerializeField] private CharacterData[] characters;
|
||||
|
||||
public bool IsPowerOn => isPowerOn;
|
||||
|
||||
public void TogglePower()
|
||||
{
|
||||
isPowerOn = !isPowerOn;
|
||||
|
||||
Debug.Log(isPowerOn
|
||||
? "[StoryComputer] 컴퓨터 전원이 켜졌습니다."
|
||||
: "[StoryComputer] 컴퓨터 전원이 꺼졌습니다.");
|
||||
|
||||
if (isPowerOn)
|
||||
{
|
||||
PrintCurrentState();
|
||||
}
|
||||
}
|
||||
|
||||
public void SaveFromComputer()
|
||||
{
|
||||
if (!CanUseComputer()) return;
|
||||
|
||||
StoryManager.Instance.Save();
|
||||
Debug.Log("[StoryComputer] 현재 스토리 상태를 저장했습니다.");
|
||||
}
|
||||
|
||||
public void LoadFromComputer()
|
||||
{
|
||||
if (!CanUseComputer()) return;
|
||||
|
||||
bool success = StoryManager.Instance.Load();
|
||||
|
||||
if (success)
|
||||
{
|
||||
Debug.Log("[StoryComputer] 저장된 스토리 상태를 불러왔습니다.");
|
||||
PrintCurrentState();
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogWarning("[StoryComputer] 불러올 저장 파일이 없습니다.");
|
||||
}
|
||||
}
|
||||
|
||||
public void ResetStoryFromComputer()
|
||||
{
|
||||
if (!CanUseComputer()) return;
|
||||
|
||||
StoryManager.Instance.ResetAll();
|
||||
Debug.Log("[StoryComputer] 스토리 상태를 초기화했습니다.");
|
||||
PrintCurrentState();
|
||||
}
|
||||
|
||||
public void PrintCurrentState()
|
||||
{
|
||||
if (StoryManager.Instance == null)
|
||||
{
|
||||
Debug.LogWarning("[StoryComputer] StoryManager가 없습니다.");
|
||||
return;
|
||||
}
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.AppendLine("========== 현재 스토리 상태 ==========");
|
||||
sb.AppendLine($"메인 진행도: {StoryManager.Instance.MainProgress}");
|
||||
sb.AppendLine();
|
||||
|
||||
sb.AppendLine("공룡별 호감도:");
|
||||
|
||||
if (characters == null || characters.Length == 0)
|
||||
{
|
||||
sb.AppendLine("- 등록된 캐릭터 없음");
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (CharacterData character in characters)
|
||||
{
|
||||
if (character == null) continue;
|
||||
|
||||
int affection = StoryManager.Instance.GetAffection(character);
|
||||
sb.AppendLine($"- {character.name}: {affection}");
|
||||
}
|
||||
}
|
||||
|
||||
sb.AppendLine("====================================");
|
||||
|
||||
Debug.Log(sb.ToString());
|
||||
}
|
||||
|
||||
private bool CanUseComputer()
|
||||
{
|
||||
if (!isPowerOn)
|
||||
{
|
||||
Debug.LogWarning("[StoryComputer] 컴퓨터 전원이 꺼져 있어서 사용할 수 없습니다.");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (StoryManager.Instance == null)
|
||||
{
|
||||
Debug.LogWarning("[StoryComputer] StoryManager가 씬에 없습니다.");
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
[ContextMenu("TEST / Power Toggle")]
|
||||
private void TestPowerToggle()
|
||||
{
|
||||
TogglePower();
|
||||
}
|
||||
|
||||
[ContextMenu("TEST / Save")]
|
||||
private void TestSave()
|
||||
{
|
||||
SaveFromComputer();
|
||||
}
|
||||
|
||||
[ContextMenu("TEST / Load")]
|
||||
private void TestLoad()
|
||||
{
|
||||
LoadFromComputer();
|
||||
}
|
||||
|
||||
[ContextMenu("TEST / Reset Story")]
|
||||
private void TestReset()
|
||||
{
|
||||
ResetStoryFromComputer();
|
||||
}
|
||||
|
||||
[ContextMenu("TEST / Print State")]
|
||||
private void TestPrintState()
|
||||
{
|
||||
PrintCurrentState();
|
||||
}
|
||||
}
|
||||
2
Assets/02_Scripts/Managers/StoryComputerSystem.cs.meta
Normal file
2
Assets/02_Scripts/Managers/StoryComputerSystem.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7169c9a1c5c96574584286a96ad2f880
|
||||
Binary file not shown.
Reference in New Issue
Block a user