Hi all,
Appologise if this has been asked before - I have done lots of research but cant seem to find much info on this.
I currently have a turn based card game which connects to a mysql database. I have php pages running the sql queries on the server for security measures.
My question is that when I pull out data from the db of the cards e.g. its id/value/name/type etc I want to use these on the fly e.g. if a card has a value of 100 then i need to subtract 20 from it where would these be stored in the scene?
I have read up on player prefs but not sure if this is the way to go?
To try to further explain my problem picture scenario below:
Player 1 has card A (currently i have this as a gameObject - not sure if this is best way?)
Player 2 has card B
Player 2 has multiple actions/spells that card B can use - these spells are held in the db and upon clicking a button (another gameobject?) it looks up in the db the spell/damage type then negates the health value of Player 1’s Card A.
QUESTION: how do you hold all this info that comes two and throw the database?
I have been racking my brains over the best way to achieve this but end up banging my head against a brick wall! Any help would be grately appreciated!
Also fantastic piece of software guys been hooked on unity for a good few weeks now!
Regards,
Chris192
Well are you retrieving the values on to your client now? if so why dont you just have a persistent object that talks to the server a sort of GameManager or MatchManager that would handle the input from the user, send it to the server which would relay it to the second client. Or am I completely reading into the problem wrong.
– HHameline