Habrador/Unity-Programming-Patterns
소개
Unity에서 프로그래밍 디자인 패턴을 구현하고, C# 예제와 각 패턴을 사용하는 경우를 제공합니다.
학습 및 교육측정된 스타 증가
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- +1
- in 1 month
- -2
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
OriginalGame 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:
- Architectural patterns. One example is the MVC (Model-View-Controller).
- Design patterns. Are more specific than architectural patterns, such as the Singleton.
- 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:
- Command
- Flyweight
- Observer
- Prototype
- Singleton
- State
- Double Buffer
- Game Loop
- Update Method
- Bytecode
- Subclass Sandbox
- Type Object
- Component
- Event Queue
- Service Locator
- Data Locality
- Dirty Flag
- Object Pool
- Spatial Partition
Other patterns:
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
- Game Programming Patterns
- Game Development Patterns with Unity 2021
- Head First Design Patterns
- Game Programming Gems
- Game Programming Gems 2
- Refactoring Guru
- Design Patterns in C# With Real-Time Examples
- Level up your code with game programming patterns
Special Thanks
- masoudarvishian for implementing Event Queue pattern, Service Locator pattern, and bug fixing.
- VladimirMirMir for bug fixing.
- JayadevHaddadi for fixing event code.
관련 프로젝트 살펴보기
불러오는 중…