-
-
Save InfiniteCanvas/fa9bab3de65bf66934f9425c02ec144d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class CardDisplay : MonoBehaviour | |
{ | |
public Card card; | |
public Text nameText; | |
public Text descriptionText; | |
public Text pointsText; | |
public Image artworkImage; | |
void Start() | |
{ | |
if(card != null) | |
DisplayCard(); | |
} | |
public void DisplayCard() | |
{ | |
nameText.text = card.cardName; | |
descriptionText.text = card.description; | |
pointsText.text = card.points.ToString(); | |
artworkImage.sprite = card.artwork; | |
} | |
public void LoadCard(Card card) | |
{ | |
if(card != null) | |
this.card = card; | |
} | |
public void ChangeCard(string cardPath) | |
{ | |
var card = Instantiate<Card>(Resources.Load<Card>(cardPath)); | |
LoadCard(card); | |
DisplayCard(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment