Create CardDatabase
This commit is contained in:
parent
18cfff1135
commit
246b2471f4
6 changed files with 50 additions and 17 deletions
|
|
@ -7,11 +7,14 @@ public class BattleController : MonoBehaviour
|
|||
public HeroId[] heroIds;
|
||||
public MonsterId[] monsterIds;
|
||||
public int maxEnergy = 6;
|
||||
public CardId[] cardIds;
|
||||
|
||||
public HeroInfoUI heroUIPrefab;
|
||||
public GameObject uiCanvas;
|
||||
public BattlePlayerControls battlePlayerControls;
|
||||
|
||||
private List<BaseCard> hand;
|
||||
|
||||
public BattleHero[] heroes;
|
||||
private GameObject[] heroSprites;
|
||||
private HeroInfoUI[] heroUIs;
|
||||
|
|
@ -29,6 +32,12 @@ public class BattleController : MonoBehaviour
|
|||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
this.hand = new List<BaseCard>();
|
||||
for (int i = 0; i < cardIds.Length; i++) {
|
||||
BaseCard newCard = CardDatabase.CreateCard(cardIds[i]);
|
||||
this.hand.Add(newCard);
|
||||
}
|
||||
|
||||
heroes = new BattleHero[3];
|
||||
heroSprites = new GameObject[3];
|
||||
heroUIs = new HeroInfoUI[3];
|
||||
|
|
@ -71,7 +80,7 @@ public class BattleController : MonoBehaviour
|
|||
|
||||
this.battlePlayerControls.OnCardUsed += this.OnCardUsed;
|
||||
this.battlePlayerControls.OnTurnPassed += this.OnTurnPassed;
|
||||
this.battlePlayerControls.SetHand(5);
|
||||
this.battlePlayerControls.SetHand(this.hand);
|
||||
|
||||
StartHeroTurn();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue