- Home /
Too subjective: This is a topic for the forums, and the OP has opened a post there. http://forum.unity3d.com/threads/design-and-naming-patterns-for-unity.257919/
Design and Naming Patterns for Unity
Hello, I'm a Windows Phone Developer and I have just finished publishing my first Unity game and really loved the tools. I am considering purchasing the pro version and developing higher-scale games.
My question: Coming from a WP background, I am used to following strict Design Patterns in my projects to write simple good code. Namely MVVM (MVC), Façade, factory patterns, singleton... One of the things I struggled a lot with in Unity was, due to how different the system is, coming up with some Design Patterns to adhere to, as to simplify writing my game, minimize bugs, and making unnecessary changes later. I wanted to know what are some of the Naming (script/class names, namespaces...), structural (folders/ script reuse), and Design patterns people use for large-scale Unity projects. Also, should one adhere to using a Façade with many adapters or reusing a single script across many GameObjects? Thanks! -Francisco
Whilst it's an interesting question it's too broad, too open ended and too opinion based for the Answers format. You might have better luck on the forums.
One little tidbit: I use a prefab Application Systems object that is added to every scene in my project, with a script that sets DontDestroyOnLoad so it always persists between levels. All application wide system scripts live on this prefab to ensure they will exist and be properly initialised etc no matter what scene you are in, and no matter what scene to start the game from. Remember to save any changes back to the prefab to keep all the scenes up to date. I have a similar top level game object that handles all the Scene specific scripts/controllers etc.
Thanks @Hucanacha, I follow a similar principle. Good to know I'm on the right path. Here is a link to the thread for anyone who wants to know more. http://forum.unity3d.com/threads/design-and-na$$anonymous$$g-patterns-for-unity.257919/
Follow this Question
Related Questions
The name 'Joystick' does not denote a valid type ('not found') 2 Answers
Where to put debug methods and variables 0 Answers
Unity architecture 3 Answers
Starting the Project 1 Answer