Hi i am currently working on a prototype in C# for a card game and need to use the game manager to get components from two separate scripts and then compare the values,
So on one script i have health and on the other i have attack, i then need the game manager script to collect both of those and see which one is greater then destroy the other card
This is what ive got so far and im not really sure how to go on from here.
p1Hp = playerOneCard.GetComponent<S_Card>().health;
p2At = playerTwoCard.GetComponent<S_Card>().Attack;
if (p1Hp >= p2At)
{
destroy playerTwoCard
}
else
{
destroy playerOneCard
}
So that’s sort of a pseudo code mixture and im not really sure how to go about doing that in code.