Add some art, fix UI anchors

This commit is contained in:
henriquenakashima 2020-09-26 15:57:58 -04:00
parent c31747bc19
commit 0ca4c3276d
22 changed files with 542 additions and 65 deletions

View file

@ -16,14 +16,23 @@ public class CardUI : MonoBehaviour
this.typeText.text = card.GetDisplayType();
this.costText.text = "" + card.GetCost();
this.effectText.text = card.GetEffectText();
Sprite sprite = Resources.Load<Sprite>(GetCardArtResourcePath(card));
this.artImage.sprite = sprite;
}
public void InitHidden() {
Color BROWN = new Color(0.14f, 0.09f, 0.04f);
this.nameText.text = "????";
this.typeText.text = "????";
this.costText.text = "????";
this.effectText.text = "????";
this.GetComponent<Image>().color = Color.black;
this.GetComponent<Image>().color = BROWN;
this.artImage.color = BROWN;
}
public string GetCardArtResourcePath(BaseCard card) {
return "CardArt/" + (card.Owner.Team == TeamChoice.Heroes? "Hero" : "Monster")
+ card.StringId;
}
// Start is called before the first frame update
@ -41,6 +50,7 @@ public class CardUI : MonoBehaviour
public bool Playable {
set {
this.GetComponent<Image>().color = value ? Color.white : Color.grey;
this.artImage.color = value ? Color.white : Color.grey;
}
}
}