|
Hello everyone, I am relatively new to unity and was digging around on various tutorials for a bit and noticed that most people in their tutorials seem to use scenes for specific states instead of various game states as us you would in C++ and DirectX. For example from what I can tell they have a Main menu scene, a game scene, and a end game scene instead of your standard Game State system where you have a CMainMenuState and a CPlayingState that derived from a base state. So my question is what are the reasons for this and is their more overhead from having multiple scenes. Also if anyone can point me in a direction that uses a statemachine to change game states in unity In I would appreciate it. I appreciate any feedback thanks everyone.
(comments are locked)
|
|
The overhead from multiple scenes is negligible. And it has the following advantages:
It has some disadvantages:
See also discussion here: http://answers.unity3d.com/questions/24956/what-is-the-best-way-to-structure-a-game-with-menu-and-levels-plus-a-level-select The only thing I would add here is that in some cases it is desirable (specifically for menus) to incorporate that material into your game scene. This manifests as an overlay rather than a separate "state case" and can be difficult to do economically using different scenes. If you're looking to produce something quickly, you can't beat using "scenes as states" but for long term maintainable code; a more traditional fsm-like solution would be desirable. (Personal preference aside.)
Mar 19 '11 at 01:27 AM
tingham
(comments are locked)
|
