- Home /
Unit Team structure
Working on a game where I need to manage teams for players and cpu players. It's so easy to try and make everything a component in Unity. I was first thinking of ditching a manager and work with tags. But my intuition says that there still needs to be a place where I manage my units.
As of right now I'm thinking of creating a Team manager which yields "Team" objects.
Team class for now:
public class Team {
public int id;
private List<GameObject> units;
public int resources;
}
edit: added more functions for completeness
Team manager for now( yes it's still a component, simply so that I can add it to my "main" entry point):
public class TeamManager : MonoBehaviour {
private static short idCount = 0;
private Team[] teamList;
public Team getNextInLine()
public void initStartTeam(int start)
public Team createTeam(string name = "" )
public Team getTeam(int id)
public void reset()
}
Is this excessive and is there an elegant way of managing teams in Unity?
Your answer
Follow this Question
Related Questions
How to Collaborate with my team ? 2 Answers
Some question about license. 3 Answers
Do I need Unity Pro to buy the collaboration license? 1 Answer
good resource about conserving memory when multiple levels share resources? 0 Answers
what is the scene management algorithm may be used in Unity? 1 Answer