Card display
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System;
|
using System;
|
||||||
|
using UnityEngine.Rendering;
|
||||||
|
|
||||||
public class CardManager : MonoBehaviour
|
public class CardManager : MonoBehaviour
|
||||||
{
|
{
|
||||||
@@ -63,16 +64,15 @@ 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)}");
|
||||||
|
|
||||||
int xOffset = -800;
|
|
||||||
if (availableCards.Count < 3)
|
|
||||||
{
|
|
||||||
xOffset = -400;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
float step = Screen.width / shuffled.Count;
|
||||||
|
float pos = step - Screen.width / (2*shuffled.Count);
|
||||||
|
|
||||||
|
|
||||||
foreach (var cardUI in shuffled)
|
foreach (var cardUI in shuffled)
|
||||||
{
|
{
|
||||||
var newCard = Instantiate(cardUI.gameObject, cardsParent.position + new Vector3(xOffset, 0, 0), Quaternion.identity, cardsParent);
|
var newCard = Instantiate(cardUI.gameObject, new Vector3(pos, Screen.height/2, 0), Quaternion.identity, cardsParent);
|
||||||
xOffset += 800;
|
pos += step;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user