- Home /
Update Variables on Prefabs in a List?
I am working on a Turn Based Combat System.
The concept in my head is this:
Player selects the Level, then selects their Characters and hits play. Play will send the selected character IDs to the server and their selected level ID. The server will send back their selected character IDs with updated stats and their appearance IDs that get applied to prefabs in the level. Now once these prefabs are created in the "world". I would like to have a gameobject that will call "Turn Manager" to be able to update these prefabs all at once every turn.
Each unit has a Speed and a Turn Meter. Every turn their meter will go up by a certain percentage and once they have full turn meter they will get to take their turn. I have all the math and script concepts done but I'm not sure how I can make the "Turn Manager" actually update every single Character Prefab's turn meter all at once every turn.
Is their a way I can add each prefab to some form of list and then have the "Turn Manager" Call each of their current Turn Meters to see who is next and tell each prefab to call a function like IncreaseTurnMeter() that will handle increasing their Turn Meter?
Are you trying to create an RPG turn system? i.e.
Each player has a turn meter that slowly fills then when it fills that player is ready to take its turn? if so I think you may be approaching it on a bit of a wonk.
Let me know and I can help. p.s. do you want this turn management to be server side or in your unity app ... either way the premise it just means writing example code is harder for server side.
Your answer
Follow this Question
Related Questions
A node in a childnode? 1 Answer
Best practice for a turn-based game 1 Answer
How do you create and control a proper turn manager? 0 Answers
Arrow Indicates "Your Turn" in a 4 players game 0 Answers
[Network] Authorative Server for MMO 0 Answers