Exemplo n.º 1
0
        // 유닛ID와 밸류를 기반으로 랜덤한 카드 생성
        public void CreateCardData(CardValue value, UnitID unit, List <Buff> buff = null)
        {
            int cost = GetUnitValue(value);

            if (buff == null)
            {
                buff = new List <Buff>();
            }

            List <Buff> copyBuff = new List <Buff>();

            for (int i = 0; i < buff.Count; i++)
            {
                copyBuff.Add(buff[i].Copy());
            }

            CardDeckList.Add(new UnitCardData(cost, UnitID.GetName(unit.GetType(), unit), GetCardFrame(value), GetSprite(unit), copyBuff, unit));
        }
Exemplo n.º 2
0
        public void Init(CardValue value, UnitID unit)
        {
            this.value = value;
            this.unit  = unit;

            cardFrame.sprite  = GameManager.Instance.CardSystem.GetCardFrame(value);
            unitSprite.sprite = GameManager.Instance.CardSystem.GetSprite(unit);

            coinText.text = GameManager.Instance.CardSystem.GetUnitValue(value).ToString();
            unitText.text = UnitID.GetName(unit.GetType(), unit);

            for (int i = 0; i < buffTextList.Count; i++)
            {
                buffTextList[i].text = "";
            }

            AddBuff(value);
        }