Files
Dino_Love_Simulation/Assets/02_Scripts/UI/computer/StoryComputerStatusBinder.cs
dldydtn9755-crypto 07cc9267a8 컴퓨터 수정
2026-07-15 12:53:00 +09:00

58 lines
1.5 KiB
C#

using UnityEngine;
public class StoryComputerStatusBinder : MonoBehaviour
{
[Header("메인 진행도 UI")]
public MainProgressUI mainProgressUI;
[Header("호감도 UI")]
public CharacterData character1;
public HeartAffectionUI heartUI1;
public CharacterData character2;
public HeartAffectionUI heartUI2;
public CharacterData character3;
public HeartAffectionUI heartUI3;
private void OnEnable()
{
Refresh();
}
public void Refresh()
{
if (StoryManager.Instance == null)
{
Debug.LogWarning("[StoryComputerStatusBinder] StoryManager가 없습니다.");
return;
}
// 메인 진행도
if (mainProgressUI != null)
{
mainProgressUI.SetProgress(StoryManager.Instance.MainProgress);
}
// 1번 캐릭터 호감도
if (character1 != null && heartUI1 != null)
{
int affection = StoryManager.Instance.GetAffection(character1);
heartUI1.SetAffection(affection);
}
// 2번 캐릭터 호감도
if (character2 != null && heartUI2 != null)
{
int affection = StoryManager.Instance.GetAffection(character2);
heartUI2.SetAffection(affection);
}
// 3번 캐릭터 호감도
if (character3 != null && heartUI3 != null)
{
int affection = StoryManager.Instance.GetAffection(character3);
heartUI3.SetAffection(affection);
}
}
}