using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class ActionCardSelector : MonoBehaviour { public List cards; // Start is called before the first frame update public GameObject cardTexture; void Start() { } // Update is called once per frame void Update() { } public void SelectCard() { int randomAction = Random.Range(0, cards.Count); RawImage m_RawImage = cardTexture.GetComponent(); //Change the Texture to be the one you define in the Inspector m_RawImage.texture = cards[randomAction]; } }