# qianmo/unity-design-pattern

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/qianmo-unity-design-pattern).**

4,659 stars · 1,021 forks · C#

## Links

- GitHub: https://github.com/QianMo/Unity-Design-Pattern
- awesome-repositories: https://awesome-repositories.com/repository/qianmo-unity-design-pattern.md

## Topics

`bridge-pattern` `command-pattern` `csharp-design-patterns` `csharp-resources` `design-pattern` `design-patterns` `facade-pattern` `factory-pattern` `game-development` `game-programming` `game-programming-pattern` `iterator-pattern` `mediator-pattern` `memento-pattern` `pool-pattern` `singleton-pattern` `unity` `unity-design-pattern` `unity3d` `visitor-pattern`

## Description

This project is a library of C# software architecture examples and a reference for game programming patterns specifically implemented for the Unity engine. It provides a collection of Gang of Four and specialized game programming patterns to organize software components and improve code scalability.

The implementation covers structural and behavioral patterns used to manage state and performance in real-time game simulations. It focuses on translating theoretical design patterns into working code to improve maintainability and system structure.

The architecture includes patterns for action encapsulation, object creation, and event messaging, as well as systems for state management, finite state machines, and behavior switching. It also utilizes interface-based decoupling to reduce dependencies between classes.

## Tags

### Education & Learning Resources

- [Unity Pattern Implementations](https://awesome-repositories.com/f/education-learning-resources/educational-resources/reference-and-media/books-docs-reference/code-examples/design-pattern-examples/unity-pattern-implementations.md) — Provides practical code examples demonstrating architectural design patterns specifically within the Unity engine.

### Part of an Awesome List

- [Patterns](https://awesome-repositories.com/f/awesome-lists/devtools/game-programming/patterns.md) — Implements specialized programming patterns to optimize runtime performance in real-time simulations. ([source](https://github.com/qianmo/unity-design-pattern#readme))
- [Design Pattern References](https://awesome-repositories.com/f/awesome-lists/media/gaming-and-game-development/design-pattern-references.md) — Serves as a reference for architectural solutions to common game development problems.
- [Sample Projects](https://awesome-repositories.com/f/awesome-lists/learning/sample-projects.md) — Design pattern implementations for C#.

### Game Development

- [Game Design Patterns](https://awesome-repositories.com/f/game-development/data-oriented-design-libraries/game-design-patterns.md) — Implements architectural patterns specifically applied to game design for state management and performance.

### Software Engineering & Architecture

- [Interface-Based Decoupling](https://awesome-repositories.com/f/software-engineering-architecture/component-abstractions/interface-based-decoupling.md) — Uses abstract interfaces to decouple game components and allow interchangeable pattern implementations.
- [Game Object Factories](https://awesome-repositories.com/f/software-engineering-architecture/dependency-injection-providers/factory-based-instantiation/game-object-factories.md) — Provides centralized instantiation logic for game objects to separate creation from business logic.
- [Finite State Machine Engines](https://awesome-repositories.com/f/software-engineering-architecture/finite-state-machine-engines.md) — Implements a finite state machine engine to manage object behavior via discrete state transitions.
- [Observer Patterns](https://awesome-repositories.com/f/software-engineering-architecture/observer-patterns.md) — Implements a subscription model for notifying objects of state changes without direct references.
- [Strategy Patterns](https://awesome-repositories.com/f/software-engineering-architecture/state-machine-logic/lightweight-state-machines/error-state-machines/behavioral-state-transition-logic/actor-behavior-switching/strategy-patterns.md) — Encapsulates algorithms into separate classes to allow runtime swapping of object behaviors.
- [Singleton Service Stores](https://awesome-repositories.com/f/software-engineering-architecture/state-management-architectures/singleton-service-stores.md) — Utilizes singleton services as centralized state containers for global access to game systems.
- [Command Patterns](https://awesome-repositories.com/f/software-engineering-architecture/stateful-logic-encapsulation/action-based-logic-encapsulations/command-patterns.md) — Implements the Command design pattern to encapsulate game actions and support undo operations.
- [Design Pattern Implementations](https://awesome-repositories.com/f/software-engineering-architecture/design-pattern-implementations.md) — Provides practical code examples demonstrating structural and behavioral software design solutions. ([source](https://github.com/qianmo/unity-design-pattern#readme))
- [Scalable Architecture Patterns](https://awesome-repositories.com/f/software-engineering-architecture/scalable-architecture-patterns.md) — Uses structural design patterns to create a decoupled architecture that scales as game complexity grows.
- [Structural Design Patterns](https://awesome-repositories.com/f/software-engineering-architecture/structural-design-patterns.md) — Applies structural design patterns to organize system components for better long-term scalability. ([source](https://github.com/qianmo/unity-design-pattern#readme))
