示例#1
0
 public void InitializePiece(HeroContent hc)
 {
     Debug.Log("Initializing: " + hc.name);
     cardPortrait = hc.cardPortrait;
     token        = hc.tokenArt;
     name         = hc.name;
     flavor       = hc.flavor;
 }
示例#2
0
        public HeroContent RandomHero()
        {
            HeroContent randomHero = null;

            if (heroContentList.Count > 0)
            {
                randomHero = heroContentList[Random.Range(0, heroContentList.Count)];
                heroContentList.Remove(randomHero);
            }

            return(randomHero);
        }
示例#3
0
        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;
            }
        }