public void LoadUnitData() { if (_unitData == null) { return; } UnitName = _unitData.UnitName; _unitID = _unitData.UnitID; _deckClass = _unitData.DeckClass; _baseHP = _unitData.BaseHP; _spriteRenderer.sprite = Resources.Load <Sprite>("Sprites/Units/" + _unitData.SpritePath); UpdateUI(); }
public void LoadCardData() { if (cardData != null) { title = cardData.Title; characterType = cardData.CharacterType; deckType = cardData.DeckType; category = cardData.Category; resourceCost = cardData.ResourceCost; description = cardData.Description; omitFromDeck = cardData.OmitFromDeck; requireTarget = cardData.RequireTarget; targetType = cardData.TargetType; areaOfEffect = cardData.AreaOfEffect; targetArea = cardData.TargetArea; effects = cardData.Effects; // Do not save. owner = cardData.Owner; } }
public CardData DrawRandomCard(Card.DeckClass deckClass, List <CardData> handList, bool removeCard = true) { if (deck.Count == 0) { PopulateDeckFromReference(handList); } // For ai control if (UnityEngine.Random.value < 0.15f) { foreach (CardData data in deck) { if (data.Title == "Block") { return(data); } } } CardData cardData; int ndx = -1; int attempts = 0; do { ndx = UnityEngine.Random.Range(0, deck.Count); cardData = deck[ndx]; } while(cardData.DeckType != deckClass && attempts < 500); if (ndx > -1 && removeCard) { deck.RemoveAt(ndx); } return(cardData); }
public void LoadCardsByClass(Card.DeckClass deckClass) { }