I’m building a solitaire game as a learning project.
I have a prefab called “Card” that represents a generic playing card. It has a box collider and my Card.cs script. It also has 2 child gameObjects, Face and Back. Each child has only a sprite renderer component to display the card image front and back.
I created a scriptable object called CardTemplateSO that contains basic card info like suit and value.
I have created assets of type CardTemplateSO that represents each card in a deck. I.e. Ace of Hearts, etc.
This feels like a good approach but I’m having trouble dynamically instantiating a card prefab and loading the correct CardTemplateSO asset.
I’m using a game manager gameObject to create 52 Card prefabs on load. I’m just not sure how to tell each Card prefab to use the correct CardTemplateSO asset.
Thanks