• Learning design patterns and architecture?
    1 replies, posted
So far I've been writing code in class to solve problems, none of it has been more than 3 or 4 classes and even then its been trivial. I started to get into Unity a few days ago and my code is a mess, I was wondering if theres any convention I should follow when writing code regarding classes and code files. Any help would be appreciated.
I'm just going to throw out my personal experience, which likely isn't the best way, but it's my way: Learn by doing. I felt the same when I started with Unity. Different games will benefit will different "architectures". Generally what I'll do is create an empty "GameManager" object to attach scripts to which manages all the stuff that needs to happen in the level or scene. It'll also manage stuff like the score, lives, the selected player, whatever I think I'll need access to reference from a lot of scripts. After that I like to create databases to manage everything in the scene so I can use Unity's GUI to add or remove stuff. For example here's how I manage the AI and player units on my level: [t]http://i.imgur.com/kpruDyU.png[/t]
Sorry, you need to Log In to post a reply to this thread.