// Use this for initialization void Start() { cardImage.sprite = cardSO.art; var bounds = cardSO.art.bounds; var factor = (transform.localScale.y / bounds.size.y) / transform.localScale.y; cardImage.transform.localScale = new Vector3(factor, factor, factor); manager = FindObjectOfType <TurnManager>(); manager.AddToList(this); }
// Use this for initialization void Start() { cardImage.sprite = cardSO.art; attackDamage.GetComponent <TextMeshPro>(); attack = cardSO.attack; health = cardSO.health; attackDamage.text = attack.ToString(); healthPoints.text = health.ToString(); var bounds = cardSO.art.bounds; var factor = (transform.localScale.y / bounds.size.y) / transform.localScale.y; cardImage.transform.localScale = new Vector3(factor, factor, factor); manager = FindObjectOfType <TurnManager>(); manager.AddToList(this); }