Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/QianMo/Unity-Design-Pattern

:tea: All Gang of Four Design Patterns written in Unity C# with many examples. And some Game Programming Patterns written in Unity C#. | 各种设计模式的Unity3D C#版本实现
https://github.com/QianMo/Unity-Design-Pattern

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

Last synced: about 2 months ago
JSON representation

:tea: All Gang of Four Design Patterns written in Unity C# with many examples. And some Game Programming Patterns written in Unity C#. | 各种设计模式的Unity3D C#版本实现

Awesome Lists containing this project

README

        

![](Media/repo-cover.jpg)

# Design Patterns Written in Unity3D
This repository is about cool design patterns written in Unity3D C#.
* Now 23 [Gang of Four Patterns] have all been finished in Unity3D in this repository.
* Each pattern contains the corresponding structure implementations, application examples and diagrams. Same way with [Naphier/unity-design-patterns], in this repository each pattern is contained in a separate folder. Inside these are a folder ("Structure") to show what classes are used in the pattern's structure in Unity3D(with a scene) and a folder or folders ("Example") showing one or more real-world example of using the pattern in Unity3D along with a scene showing it in action. Each pattern folder may contain one or more Example.
* Game design patterns from book [Game Programming Patterns] have been partially implemented.

此repo为Unity3D中各种设计模式的实践与运用。
* 目前已经在Unity中实现了《[设计模式:可复用面向对象软件的基础]》一书中提出的23种设计模式。
* 每种模式都包含对应的结构实现、应用示例以及图示介绍。类似[Naphier/unity-design-patterns]的结构,此repo中的每种模式用单独的文件夹分开。每种模式对应的文件夹中包含了名为“Structure”的子文件夹,里面存放的是此模式在Unity中的使用代码的基本框架实现,而另外包含的Example子文件夹中存放的是此模式在Unity中使用的实际示例。每种框架实现或实例示例实现都包含对应的场景,每种模式文件夹中可能包含一个或者多个Example。
* 《[游戏编程模式]》一书中介绍的常用游戏设计模式的Unity版实现也有部分实现。

# Contents
## I、Gang of Four Patterns in Unity (23种GOF设计模式的Unity实现)
### Behavioral Patterns 行为型模式
* [Command Pattern 命令模式]
* [State Pattern 状态模式]
* [Observer Pattern 观察者模式]
* [Chain of Responsibility Pattern 责任链模式]
* [Mediator Pattern 中介者模式]
* [Interpreter Pattern 解释器模式]
* [Iterator Pattern 迭代器模式]
* [Memento Pattern 备忘录模式]
* [Strategy Pattern 策略模式]
* [Template Method Pattern 模板方法模式]
* [Visitor Pattern 访问者模式]

### Structural Patterns 结构型模式
* [Adapter Pattern 适配器模式]
* [Bridge Pattern 桥接模式]
* [Composite Pattern 组合模式]
* [Decorator Pattern 装饰模式]
* [Facade Pattern 外观模式]
* [Flyweight Pattern 享元模式]
* [Proxy Pattern 代理模式]

### Creational Patterns 创建型模式
* [Prototype Pattern 原型模式]
* [Singleton Pattern 单例模式]
* [Abstract Factory Pattern 抽象工厂模式]
* [Builder Pattern 建造者模式]
* [Factory Method Pattern 工厂方法模式]


## II、Game Programming Patterns in Unity (《游戏编程模式》的Unity实现)
* [Subclass Sandbox Pattern 子类沙盒模式]
* [Type Object Pattern 类型对象模式]
* [Component Pattern 组件模式]
* [Event Queue Pattern 事件队列模式]
* [Game Loop Pattern 游戏循环模式]
* [Service Locator Pattern 服务定位器模式]
* [Data Locality Pattern 数据局部性模式]
* [Dirty Flag Pattern 脏标记模式]
* [Object Pool Pattern 对象池模式]

# Reference resources(参考)

* http://gameprogrammingpatterns.com/
* https://www.youtube.com/playlist?list=PLF206E906175C7E07
* https://github.com/Naphier/unity-design-patterns
* http://www.dofactory.com/net/design-patterns
* https://sourcemaking.com/design_patterns
* http://www.habrador.com/tutorials/programming-patterns/
* [Gang of Four Patterns]
* [Head First Design Patterns]
* [设计模式与游戏完美开发]

[State Pattern 状态模式]:https://github.com/QianMo/Unity3D-Design-Patterns/tree/master/Assets/Behavioral%20Patterns/State%20Pattern
[Command Pattern 命令模式]: https://github.com/QianMo/Unity-Design-Pattern/tree/master/Assets/Behavioral%20Patterns/Command%20Pattern
[Observer Pattern 观察者模式]:https://github.com/QianMo/Unity-Design-Pattern/tree/master/Assets/Behavioral%20Patterns/Observer%20Pattern
[Chain of Responsibility Pattern 责任链模式]:https://github.com/QianMo/Unity-Design-Pattern/tree/master/Assets/Behavioral%20Patterns/Chain%20of%20Responsibility%20Pattern
[Mediator Pattern 中介者模式]:https://github.com/QianMo/Unity-Design-Pattern/tree/master/Assets/Behavioral%20Patterns/Mediator%20Pattern
[Interpreter Pattern 解释器模式]:https://github.com/QianMo/Unity-Design-Pattern/tree/master/Assets/Behavioral%20Patterns/Interpreter%20Pattern
[Iterator Pattern 迭代器模式]:https://github.com/QianMo/Unity-Design-Pattern/tree/master/Assets/Behavioral%20Patterns/Iterator%20Pattern
[Memento Pattern 备忘录模式]:https://github.com/QianMo/Unity-Design-Pattern/tree/master/Assets/Behavioral%20Patterns/Memento%20Pattern
[Strategy Pattern 策略模式]:https://github.com/QianMo/Unity-Design-Pattern/tree/master/Assets/Behavioral%20Patterns/Strategy%20Pattern
[Template Method Pattern 模板方法模式]:https://github.com/QianMo/Unity-Design-Pattern/tree/master/Assets/Behavioral%20Patterns/Template%20Method%20Pattern
[Visitor Pattern 访问者模式]:https://github.com/QianMo/Unity-Design-Pattern/tree/master/Assets/Behavioral%20Patterns/Visitor%20Pattern
[Adapter Pattern 适配器模式]:https://github.com/QianMo/Unity-Design-Pattern/tree/master/Assets/Structural%20Patterns/Adapter%20Pattern
[Bridge Pattern 桥接模式]:https://github.com/QianMo/Unity-Design-Pattern/tree/master/Assets/Structural%20Patterns/Bridge%20Pattern
[Composite Pattern 组合模式]:https://github.com/QianMo/Unity-Design-Pattern/tree/master/Assets/Structural%20Patterns/Composite%20Pattern
[Decorator Pattern 装饰模式]:https://github.com/QianMo/Unity-Design-Pattern/tree/master/Assets/Structural%20Patterns/Decorator%20Pattern
[Facade Pattern 外观模式]:https://github.com/QianMo/Unity-Design-Pattern/tree/master/Assets/Structural%20Patterns/Facade%20Pattern
[Flyweight Pattern 享元模式]:https://github.com/QianMo/Unity-Design-Pattern/tree/master/Assets/Structural%20Patterns/Flyweight%20Pattern
[Proxy Pattern 代理模式]:https://github.com/QianMo/Unity-Design-Pattern/tree/master/Assets/Structural%20Patterns/Proxy%20Pattern
[Abstract Factory Pattern 抽象工厂模式]:https://github.com/QianMo/Unity-Design-Pattern/tree/master/Assets/Creational%20Patterns/Abstract%20Factory%20Pattern
[Builder Pattern 建造者模式]:https://github.com/QianMo/Unity-Design-Pattern/tree/master/Assets/Creational%20Patterns/Builder%20Pattern
[Factory Method Pattern 工厂方法模式]:https://github.com/QianMo/Unity-Design-Pattern/tree/master/Assets/Creational%20Patterns/Factory%20Method%20Pattern
[Prototype Pattern 原型模式]:https://github.com/QianMo/Unity-Design-Pattern/tree/master/Assets/Creational%20Patterns/Prototype%20Pattern
[Singleton Pattern 单例模式]:https://github.com/QianMo/Unity-Design-Pattern/tree/master/Assets/Creational%20Patterns/Singleton%20Pattern

[Subclass Sandbox Pattern 子类沙盒模式]:https://github.com/QianMo/Unity-Design-Pattern/tree/master/Assets/Game%20Programming%20Patterns/SubclassSandbox%20Pattern
[Type Object Pattern 类型对象模式]:https://github.com/QianMo/Unity-Design-Pattern/tree/master/Assets/Game%20Programming%20Patterns/Type%20Object%20Pattern
[Component Pattern 组件模式]:https://github.com/QianMo/Unity-Design-Pattern/tree/master/Assets/Game%20Programming%20Patterns/Component%20Pattern
[Event Queue Pattern 事件队列模式]:https://github.com/QianMo/Unity-Design-Pattern/tree/master/Assets/Game%20Programming%20Patterns/Event%20Queue%20Pattern
[Game Loop Pattern 游戏循环模式]:https://github.com/QianMo/Unity-Design-Pattern/tree/master/Assets/Game%20Programming%20Patterns/Game%20Loop%20Pattern
[Service Locator Pattern 服务定位器模式]:
https://github.com/QianMo/Unity-Design-Pattern/tree/master/Assets/Game%20Programming%20Patterns/Service%20Locator%20Pattern
[Data Locality Pattern 数据局部性模式]:
https://github.com/QianMo/Unity-Design-Pattern/tree/master/Assets/Game%20Programming%20Patterns/Data%20Locality%20Pattern
[Dirty Flag Pattern 脏标记模式]:
https://github.com/QianMo/Unity-Design-Pattern/tree/master/Assets/Game%20Programming%20Patterns/Dirty%20Flag%20Pattern
[Object Pool Pattern 对象池模式]:
https://github.com/QianMo/Unity-Design-Pattern/tree/master/Assets/Game%20Programming%20Patterns/Object%20Pool%20Pattern

[Gang of Four Patterns]:https://www.amazon.com/Design-Patterns-Elements-Reusable-Object-Oriented/dp/0201633612/ref=sr_1_1?ie=UTF8&qid=1476338345&sr=8-1&keywords=design+patterns
[Game Programming Patterns]:http://gameprogrammingpatterns.com/
[设计模式:可复用面向对象软件的基础]:https://www.amazon.cn/%E8%AE%A1%E7%AE%97%E6%9C%BA%E7%A7%91%E5%AD%A6%E4%B8%9B%E4%B9%A6-%E8%AE%BE%E8%AE%A1%E6%A8%A1%E5%BC%8F-%E5%8F%AF%E5%A4%8D%E7%94%A8%E9%9D%A2%E5%90%91%E5%AF%B9%E8%B1%A1%E8%BD%AF%E4%BB%B6%E7%9A%84%E5%9F%BA%E7%A1%80-Erich-Gamma/dp/B001130JN8/ref=sr_1_1?ie=UTF8&qid=1476338390&sr=8-1&keywords=%E8%AE%BE%E8%AE%A1%E6%A8%A1%E5%BC%8F
[游戏编程模式]:http://gameprogrammingpatterns.com/
[Head First Design Patterns]:https://www.amazon.com/dp/0596007124//ref=cm_sw_su_dp?tag=nethta-20
[Naphier/unity-design-patterns]:https://github.com/Naphier/unity-design-patterns
[设计模式与游戏完美开发]:https://www.amazon.cn/dp/B01N9GO0ZC