Les Icônes se mettent correctement à jour durant la partie. Update de BaseMonoBehaviour, on peux maintenant ajouter une couleur a Info().
This commit is contained in:
parent
aac376670c
commit
2b5a227237
10 changed files with 142 additions and 1163 deletions
|
|
@ -18,14 +18,21 @@ namespace GameUI.Runtime
|
|||
|
||||
#region Unity API
|
||||
|
||||
void Start()
|
||||
void OnEnable()
|
||||
{
|
||||
QuestManager.OnQuestCompleted += HandleQuestCompleted;
|
||||
QuestManager.OnQuestCompleted += HandleQuestState;
|
||||
QuestManager.OnCheckStateQuest += HandleQuestState;
|
||||
// Re-synchroniser l'état quand l'UI s'active
|
||||
if (QuestManager.Instance != null)
|
||||
{
|
||||
QuestManager.Instance.CheckStateQuest();
|
||||
}
|
||||
}
|
||||
|
||||
void OnDestroy()
|
||||
void OnDisable()
|
||||
{
|
||||
QuestManager.OnQuestCompleted -= HandleQuestCompleted;
|
||||
QuestManager.OnQuestCompleted -= HandleQuestState;
|
||||
QuestManager.OnCheckStateQuest -= HandleQuestState;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
|
@ -49,9 +56,10 @@ namespace GameUI.Runtime
|
|||
#region Utils
|
||||
|
||||
/* Fonctions privées utiles */
|
||||
void HandleQuestCompleted(QuestClass quest)
|
||||
void HandleQuestState(QuestClass quest)
|
||||
{
|
||||
if (!MatchesQuest(quest.Name)) return;
|
||||
Info($"Etat de la quete {quest.Name} : {quest.State}", Color.burlywood);
|
||||
switch (quest.State)
|
||||
{
|
||||
case QuestStateEnum.Disponible:
|
||||
|
|
@ -63,6 +71,7 @@ namespace GameUI.Runtime
|
|||
m_hourglass.SetActive(true);
|
||||
break;
|
||||
case QuestStateEnum.Completed:
|
||||
Info("Completed !!", Color.green);
|
||||
m_check.SetActive(true);
|
||||
m_hourglass.SetActive(false);
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue