How to create a turn based system manager?
Working on a project right now that's board-game esque with an asymmetrical style system. Following another guide, I've managed to get the movement working, but the guide's turn manager worked off a Queue system, meaning if I wanted to manually set or shuffle player turns, it wouldn't work. The list of players was initiated through a Dictionary in the guide, but loading/clearing the list was written as an enqueue and dequeue, which works fine, but isn't how I intend to run the game. Surprisingly hard to find many board game guides on Unity, but from the research I've been going through, it points to the Queue being the problem as it can't manually be accessed or adjusted.
From here I'm working on creating a new turn manager using just lists, as I'd be able to add/remove/change specific indexes more appropriately. However, since the type I'm trying to access is a GameObject to represent the players, I'm not exactly how to "Add" to the list. Am I thinking too much into this, or would it be better to create scripts for each individual character, have them inherit from the player's class and just reference the player's class in the list?
I dont really understand your question, your problem is not being able to access the player objects? can you reference to the objects in the scene using tag/name, or just pass a reference to those objects at start?
The logic of the code I am trying to shoot for is this. 4 players load in. Through a rand., it will configure the order of the players. However, each player object is diffferent as it has adjusted values in the inspector. What I am trying to do, at the very least, is set each player's turn manually and then when that can be achieved, randomly. I'm not sure how to go about it though as I am not sure how I can set each player object in the list
Your answer
Follow this Question
Related Questions
Enemy Database using list/dictionary to store stats (C#)? 1 Answer
InvalidOperationException: Operation is not valid due to the current state of the object 1 Answer
Insert string into empty list at a specific index 0 Answers
Need help to generate a random assortment of 4 buttons - C# 0 Answers
Queue a Coroutine with a List? 1 Answer