public void InitializePiece(HeroContent hc) { Debug.Log("Initializing: " + hc.name); cardPortrait = hc.cardPortrait; token = hc.tokenArt; name = hc.name; flavor = hc.flavor; }
public HeroContent RandomHero() { HeroContent randomHero = null; if (heroContentList.Count > 0) { randomHero = heroContentList[Random.Range(0, heroContentList.Count)]; heroContentList.Remove(randomHero); } return(randomHero); }
public override void Execute(GameData data) { heroContent = heroIndex.RandomHero(); if (heroContent != null) { CardInstance newCard = Instantiate(cardPrefab); newCard.transform.SetParent(GameObject.Find("HeroPanel").transform); //Don't like this hard reference. newCard.name = heroContent.name; newCard.isDraggable = true; var hero = ScriptableObject.CreateInstance <Hero>(); hero.InitializePiece(heroContent); hero.isActive = true; newCard.GetComponent <CardInstance>().pieceDetails = hero; } }