Designing a card game, here’s the thinking: Have a Player Object > Hand Object > Individual Card Objects
Card.cs is attached to a prefab; in Card, there is a CardComponent class which is a scriptable class that provides the actual functionality of the card. My basic card is “Deal 1 Damage”, which can be dodged by the player or enemy. Thus, I want to be able to select targets back-and-forth. I want to reference the parent game object (aka Player Object), from the CardComponent which is used by Card.cs. Please advise.,Designing a card game here: the thinking is to have a Player object> Hand Object > Individual Cards
A Card is a ScriptableObject have a single CardComponent (separate class). I want my separate CardComponent to be able to identify the parent game object (meaning the Player object) because it is an interaction-based game. For example, the player plays an Attack card, and the enemy can play a dodge card, and vice versa, thus needing a interchanging target selection mechanism. I wanted the CardComponent to identify its origin/parent GameObject and then the user can choose the target GameObject. Please advise.