- Home /
Deck Editor
I currently have a Scriptable Object (hereafter called SO) of type CardSet, containing a List of Card SOs. I have three CardSets, representing the Master List (all the cards that exist in game), the Collection (the cards the player has acquired so far), and the Deck (the cards the player wants to use for the next phase of play).
What I'm trying to figure out is whether there's any way to cleanly associate the Card SO with an object deriving information from it. For example, my deck editor instantiates CardSlots, which draw a list of Card SOs from your Collection and displays them as basically a set of buttons you can push. When you do, it checks whether your deck has room and whether you actually have a copy of that card left to put in. If you do, the button produces a button bearing the name of that card, in the deck zone on the left. When the button is produced this way it also gets a reference to where it came from - the specific CardSlot. This way if you click the in-deck button for the card, to remove it from your deck, the CardSlot knows to add 1 to its set of available cards. Unfortunately if you make a deck and then turn off the game and turn it back on, the scene knows you have cards in the Deck CardSet but DOESN'T know how to refill the list of "remove cards from the deck" buttons that show you what's IN your deck. Because I don't have a way set up to link the Card SO with the unique CardSlot GameObject in the scene that uses that SO to set up its display.