Rough design of one card
This commit is contained in:
@@ -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))}");
|
||||
|
||||
Reference in New Issue
Block a user