Rough design of one card

This commit is contained in:
2025-07-28 01:40:34 +02:00
parent 6179c5bc0e
commit 058170bbf9
2 changed files with 138 additions and 4 deletions

View File

@@ -46,20 +46,17 @@ public class CardManager : MonoBehaviour
{
var unlockedSkills = playerSkillTree.GetPlayerSkills();
// Projdeme všechny prefaby a zkontrolujeme jejich skill
var availableCards = cardPrefabs
.Select(x => x.GetComponent<CardUI>())
.Where(x => x != null && !unlockedSkills.Contains(x.Skill))
.ToList();
// Vyčistíme staré karty
foreach (Transform child in cardsParent)
{
Destroy(child.gameObject);
}
// Vybereme náhodné karty
var shuffled = availableCards.OrderBy(x => UnityEngine.Random.value).Take(count).ToList();
Debug.Log($"Showing cards: {string.Join(", ", shuffled.Select(x => x.Skill))}");