Edge case fix
Fixed an edge case where there were no cards left and it caused an error
This commit is contained in:
@@ -64,7 +64,10 @@ public class CardManager : MonoBehaviour
|
|||||||
Debug.Log($"Available cards: {string.Join(", ", availableCards.Select(x => x.Skill))}");
|
Debug.Log($"Available cards: {string.Join(", ", availableCards.Select(x => x.Skill))}");
|
||||||
Debug.Log($"Unlocked skills: {string.Join(", ", unlockedSkills)}");
|
Debug.Log($"Unlocked skills: {string.Join(", ", unlockedSkills)}");
|
||||||
|
|
||||||
|
|
||||||
|
if (shuffled.Count <= 0)
|
||||||
|
return;
|
||||||
|
|
||||||
float step = Screen.width / shuffled.Count;
|
float step = Screen.width / shuffled.Count;
|
||||||
float pos = step - Screen.width / (2*shuffled.Count);
|
float pos = step - Screen.width / (2*shuffled.Count);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user