- Home /
How do I reset the game state in a multiplayer game?
I'm working on a networked multiplayer game. After a player wins, I'd like the ability to restore the game and all connected clients to the original state from when the game first began.
Answer by ShelbyP67 · Apr 28, 2013 at 02:30 AM
I just started learning Unity today, so I won't know the details as far as in application experience. What I can say though is that you will need a subclass that player will inherit from, call it GameState. Your GameState class will need an enum with your states and you will either need to use the built in get/set methods provided by c# or create your own to retrieve and set current state. Keep in mind the more you dumb down your code, the better off you will be. Generally makes it more flexible and applicable in the end.