mixedcards/Assets/Battle/UI/CardUI.cs
2020-09-24 23:29:30 -04:00

46 lines
1.1 KiB
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class CardUI : MonoBehaviour
{
public Text nameText;
public Text typeText;
public Text costText;
public Image artImage;
public Text effectText;
public void Init(BaseCard card) {
this.nameText.text = card.GetDisplayName();
this.typeText.text = card.GetDisplayType();
this.costText.text = "" + card.GetCost();
this.effectText.text = card.GetEffectText();
}
public void InitHidden() {
this.nameText.text = "????";
this.typeText.text = "????";
this.costText.text = "????";
this.effectText.text = "????";
this.GetComponent<Image>().color = Color.black;
}
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
public bool Playable {
set {
this.GetComponent<Image>().color = value ? Color.white : Color.grey;
}
}
}