Mise à jour signale du panneau

This commit is contained in:
mrtoine 2025-10-10 09:21:12 +02:00
parent 016c834f21
commit 2370cb670d
31 changed files with 397 additions and 1611 deletions

View file

@ -5,7 +5,8 @@
"GUID:2ca720bbf8aa349608caa5ce4acaa603",
"GUID:d01b71ecbce444a299cc1623f29e9d35",
"GUID:4a640bb60ad60478bba0cc41f9b80929",
"GUID:f5d0434d9e8c34eb1a16f4c57b172b85"
"GUID:f5d0434d9e8c34eb1a16f4c57b172b85",
"GUID:239153993e9574192a1980e14075369e"
],
"includePlatforms": [],
"excludePlatforms": [],

View file

@ -1,4 +1,11 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Core.Runtime;
using EventSystem.Runtime;
using Player.Runtime;
using Quests.Runtime;
using UnityEngine;
namespace Decor.Runtime
{
@ -6,14 +13,63 @@ namespace Decor.Runtime
{
#region private & protected
[SerializeField] GameObject _parchment;
int _quests;
PlayerClass _player;
#endregion
#region Unity API
void Awake()
{
_player = GetFact<PlayerClass>(GameManager.Instance.Profile);
}
void Start()
{
//UpdateParchmentState();
Info($"<color=yellow>Il y a actuellement {_quests} quêtes affichés sur le Panneau</color>");
}
void Update()
{
UpdateParchmentState();
}
#endregion
#region Main Methods
//
#endregion
#region Utils
void UpdateParchmentState()
{
List<QuestTemplate> availableTemplates = QuestManager.Instance.GetAvailableQuests(_player.GuildLevel);
var allPossibleQuests = QuestManager.Instance.GetAvailableQuests(_player.GuildLevel);
// 2. Quêtes déjà démarrées (actives OU complétées)
var startedQuests = QuestManager.Instance.ActiveQuests
.Concat(QuestManager.Instance.CompletedQuests)
.ToList();
// 3. Quêtes vraiment disponibles = possibles - déjà démarrées
bool hasTrulyAvailableQuests = allPossibleQuests
.Any(possibleQuest =>
!startedQuests.Any(startedQuest =>
startedQuest.Name == possibleQuest.data.Name
)
);
_parchment.SetActive(hasTrulyAvailableQuests);
Info($"<color=green>Il y a actuellement {hasTrulyAvailableQuests} disponibles</color>");
}
#endregion
}
}