컴퓨터 수정
This commit is contained in:
58
Assets/02_Scripts/UI/computer/StoryComputerStatusBinder.cs
Normal file
58
Assets/02_Scripts/UI/computer/StoryComputerStatusBinder.cs
Normal file
@@ -0,0 +1,58 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user