Home

Awesome

Unity Best Practices

Design principles, design patterns, coding challenges, and more!

<img src="./Unity/Assets/Samples/~ Shared/Documentation/Images/BestPractices.png" width="600" /> <BR>

Details

Here is a complete overview of Best Practices and related topics for Unity.

The repo is complete with code samples.

Enjoy!

<BR> <BR>

Related Repos

NameDescriptionEducational UseProduction UseLink
Unity Best PracticesRepo with best practices for Unity. It covers project structure and code standards.(See below)
Unity Project TemplateTemplate showcasing best practices and coding standards for Unity projects.link
<BR> <BR>

Table of Contents

  1. Configuration
  2. Design Principles
  3. Design Patterns
  4. Features
  5. Tooling
  6. Credits
<BR> <BR>

Getting Started

Instructions

  1. Download this repo (*.zip or *.git)
  2. Download the Unity Editor (See Unity Version below)
  3. Open the Unity Hub
  4. Unity Hub: Click the 'Add' button
  5. Unity Hub: Choose the Unity folder from the repo
  6. Unity Hub: Choose the project from the project list to open the Unity Editor
  7. Unity Editor: Open one of the included Scenes
  8. Unity Editor: Play the Scene
  9. Enjoy!
<BR> <BR>

Configuration

Documentation

Configuration

Structure

Dependencies

<BR> <BR>

Design Principles

Theory

S.O.L.I.D. Principles make software designs more understandable, easier to maintain and easier to extend. As a software engineer, these 5 principles are essential to know! (See <a href="https://itnext.io/solid-principles-explanation-and-examples-715b975dcad4">ITNext.io</a>)

List

NameDescriptionCode Sample Complete
Single ResponsibilityOne reason to change.
Open/ClosedOpen for extension, closed for modification.
Liskov SubstitutionSubtypes must be substitutable for their base types.
Interface SegregationNo client should be forced to depend on interfaces they do not use.
Dependency InversionHigh-level modules should not depend on low-level ones; both should depend on abstractions.
<BR> <BR>

Design Patterns

Theory

These patterns provide solutions to common design problems and are a foundational part of software design knowledge. There are 3 types.

<BR>

Diagram

<BR> <img src="./Unity/Assets/Samples/~ Shared/Documentation/Images/design-patterns.gif" width="600" /> <BR> <BR>

List

TypeNameDescriptionCode Sample Complete
Behavioral
Chain of ResponsibilityPasses request among a chain of objects.
CommandEncapsulates a request as an object.
InterpreterProvides a language interpreter.
IteratorSequentially access elements in a collection.
MediatorCentralized external communications.
MementoCapture and restore object's internal state.
ObserverNotify changes to its state.
StateAlter behavior when its state changes.
StrategyEncapsulates algorithms using strategy pattern.
Template MethodDefer exact steps to subclasses.
VisitorAdd new operations without altering a class.
Creational
Abstract FactoryCreates families of related objects.
BuilderSeparates object construction from its representation.
Factory MethodCreates objects without specifying the exact class to create.
PrototypeClone or copy initialized instances.
SingletonEnsures a class has one instance.
Structural
AdapterMatches interfaces of different classes.
BridgeSeparates an object’s interface from its implementation.
CompositeTree structure of simple and composite objects.
DecoratorAdds responsibilities to objects dynamically.
FacadeSimplified interface to a subsystem.
FlyweightReuses objects by sharing common state.
ProxyRepresents another object.
<BR> <BR>

Features

Tooling

<BR> <BR>

Credits

Created By

Contact

License

Provided as-is under <a href="./LICENSE">MIT License</a> | Copyright ™ & © 2006 - 2024 Rivello Multimedia Consulting, LLC