← Winnitude! Search  ·  Reader Mode (715 ms)
Links: Stay in Reader Retro Site Converter Retro Mode: OFF Original Page ↗
GITHUB · 115 LINKS

GitHub - Habrador/Unity-Programming-Patterns: Implementations of programming design patterns in Unity with examples in C# when to use them.

Repository navigation

Unity-Programming-Patterns
Public

About

Implementations of programming design patterns in Unity with examples in C# when to use them.

www.habrador.com/tutorials/programming-patterns/

Topics

architecture command-pattern computer-science design-patterns factory-pattern flyweight-pattern game-programming-pattern object-pool object-pool-pattern observer-pattern principles prototype-pattern singleton-pattern software-engineering spatial-partitioning state-pattern subclass-sandbox-pattern type-object-pattern unity unity3d

Resources

Readme MIT license Activity

Stars

2.1k stars

Watchers

62 watching

Forks

275 forks Report repository
Branches

Tags
Go to Branches page Go to Tags page

Latest commit

 

History


146 Commits
View commit history for this file.

Folders and files

Name Name Last commit message Last commit date
Assets Assets    
Packages Packages    
ProjectSettings ProjectSettings    
_images _images    
_text _text    
.gitignore .gitignore    
.vsconfig .vsconfig    
LICENSE LICENSE    
README.md README.md    

Repository files navigation

Game programming patterns in Unity

Here you can find a collection of programming (design) patterns in Unity, mainly from the book Game Programming Patterns . These are very useful to better organize your Unity project as it grows because they capture best practices and solutions to commonly occuring problems. You don't have to use them - you should see them as tools in your toolbox. You can also experiment with how they are implemented to fit your specific needs. Some patterns, such as Update, Game Loop, Component, are already built-in into Unity so you are already using them!

Programming patterns can be divided into the following groups:

  1. Architectural patterns. One example is the MVC (Model-View-Controller).
  2. Design patterns. Are more specific than architectural patterns, such as the Singleton.
  3. Anti-patterns. Are a collection of patterns programmers are using to solve problems even though they shouldn't use them because they are ineffective solutions. One example is a "God object," most likely called GameController where you collect everything you might need to make the game work. The problem with such as class is that it will grow in size, which will make it more difficult to maintain, and it will also be difficult to debug because the code doesn't belong together.

Patterns from the book Game Programming Patterns:

  1. Command
  2. Flyweight
  3. Observer
  4. Prototype
  5. Singleton
  6. State
  7. Double Buffer
  8. Game Loop
  9. Update Method
  10. Bytecode
  11. Subclass Sandbox
  12. Type Object
  13. Component
  14. Event Queue
  15. Service Locator
  16. Data Locality
  17. Dirty Flag
  18. Object Pool
  19. Spatial Partition

Other patterns:

  1. Decorator
  2. Factory
  3. Facade
  4. Template

Note that these are not all patterns out there. I recently read a book called "Machine Learning Design Patterns" which includes even more design patterns with a focus on machine learning problems. But I will continue adding patterns as I find them and if they are related to game development.

Sources and Read More

Special Thanks

About

Implementations of programming design patterns in Unity with examples in C# when to use them.

www.habrador.com/tutorials/programming-patterns/

Topics

architecture command-pattern computer-science design-patterns factory-pattern flyweight-pattern game-programming-pattern object-pool object-pool-pattern observer-pattern principles prototype-pattern singleton-pattern software-engineering spatial-partitioning state-pattern subclass-sandbox-pattern type-object-pattern unity unity3d

Resources

Readme MIT license Activity

Stars

2.1k stars

Watchers

62 watching

Forks

275 forks Report repository

Releases

Packages

Used by

Contributors

Languages