refactorisation du QuestSystem
This commit is contained in:
parent
2370cb670d
commit
5fa20c954c
11 changed files with 128 additions and 39 deletions
|
|
@ -44,14 +44,13 @@ namespace GameUI.Runtime
|
|||
Destroy(child.gameObject);
|
||||
}
|
||||
|
||||
if (FactExists<List<QuestClass>>("quests", out _))
|
||||
if (FactExists<List<QuestClass>>(SaveKeys.Active, out _))
|
||||
{
|
||||
List<QuestClass> questsFromSave = GetFact<List<QuestClass>>("quests");
|
||||
|
||||
List<QuestClass> quests = QuestManager.Instance.ResolveQuestsList(questsFromSave);
|
||||
foreach (var quest in quests)
|
||||
// Show only accepted quests in this panel
|
||||
List<QuestClass> accepted = GetFact<List<QuestClass>>(SaveKeys.Active);
|
||||
foreach (var quest in accepted.Where(q => q.State == QuestStateEnum.Accepted))
|
||||
{
|
||||
DisplayQuest(quest); //=> Key : L'id de la quête, Value : Le State
|
||||
DisplayQuest(quest);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -70,6 +69,8 @@ namespace GameUI.Runtime
|
|||
questMini.m_check?.SetActive(isCompleted);
|
||||
}
|
||||
|
||||
Info($"<color=green>On affiche la quete : {quest.Name}</color>");
|
||||
|
||||
questGO.GetComponent<InteractionQuestCard>().SetQuest(quest);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue