• Stars
    star
    179
  • Rank 214,039 (Top 5 %)
  • Language
    C#
  • Created over 1 year ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A demo project to showcase design patterns and game architecture using ScriptableObjects

Welcome to the ScriptableObjects Paddle Ball project

This demo project showcases design patterns and game architecture using ScriptableObjects. It’s intended to be explored together with the e-book, Create modular game architecture in Unity with ScriptableObjects.
Header-600x300 (1)

The demo provides examples of how ScriptableObjects can help you create components that are testable and scalable, while still being designer-friendly. Although such a game could be built with far fewer lines of code, the purpose here is to show ScriptableObjects in action in a popular game design. In most cases, the code examples favor clarity over compactness.

Getting Started

Start the project from the Bootloader_Scene scene. There are two parts to the project:

  1. The code examples of design patterns that show how ScriptableObjects can solve recurring problems in Unity development
  2. The mini games that show how to put these patterns together into small working applications

Read the six mini-guides listed below to understand the implementations in the demo.

Design Patterns

The design patterns using ScriptableObjects that are included in the example project are:

  • Data containers: How to store static data for use at runtime
  • Delegate objects: How to encapsulate interchangeable logic into its own ScriptableObject
  • Event Channels: How to help your objects communicate
  • Enums: How to use a ScriptableObject instead of a traditional enum for better comparison operations
  • Runtime Sets: How to store frequently accessed objects or components from any scene without the need for a singleton

Mini games

The project includes several variants of a basic paddle and ball game to illustrate how to put these patterns together into functional game systems:

  • Classic: Shows a basic implementation of ScriptableObjects in a classic paddle and ball game
  • Hockey: Shows how to define custom wall positions using serialized text
  • Foosball: Shows how to use a Prefab definition for the level walls

Read the six-part guide with the demo

These six articles will provide you with a full understanding of what's being shown in the demo:

You will likely need additional tools and support to adapt these patterns to your specific production needs. For additional examples of what is possible with ScriptableObjects, please see the following:

Learn more advanced coding best practices in Unity

The ScriptableObjects e-book is the third in our series of advanced guides for Unity developers. Each guide, authored by experienced programmers, provides best practices for specific topics that are important to development teams.

Create a C# style guide: Write cleaner code that scales guides teams in developing a style guide to help unify their approach for creating a more cohesive codebase.

Level up your code with game programming patterns highlights best practices for using the SOLID principles and common programming patterns to create scalable game code architecture in your Unity project.

More Repositories

1

open-project-1

Unity Open Project #1: Chop Chop
C#
5,672
star
2

ShaderGraph_ExampleLibrary

A library of Shaders created using Unity's Shader Graph.
ShaderLab
1,756
star
3

ATerribleKingdom

Scripting the Timeline for games in creative ways. Includes a small RTS game build on the 'A Mighty Kingdom' assets
C#
786
star
4

AngryBots_ECS

The DOTS project used for the presentation Converting Your Game to DOTS
C#
666
star
5

InputSystem_Warriors

Example Project for the new Unity Input System
ShaderLab
555
star
6

MinecraftECS

This is a Workshop Project that made for a User group talk in Taiwan, It's about how to create a Minecraft like environment with huge number of blocks using ECS
C#
550
star
7

MachineLearningRoguelike

A small Roguelike game that uses Machine Learning to power its entities. Originally used in talks by Ciro & Alessia.
C#
438
star
8

LoadyDungeons

Demo for CCD+Addressables training and workshops.
C#
250
star
9

LWRPScriptableRenderPass_ExampleLibrary

ShaderLab
246
star
10

PhotoMode

A virtual photography system for creating in-game screenshots and photographic effects within Unity projects.
ShaderLab
232
star
11

Presentation

No need to switch to Power Point anymore.
C#
231
star
12

URP-Defender-Character-Demo

TressFX Hair plugin (Beta), Character Package, and Hairstyles assets for Universal
HLSL
223
star
13

Test_ShaderGraphBlog

Example Project to demonstrate Vertex Animation Shaders using Shader Graph.
C#
223
star
14

AngryBots2

C#
213
star
15

GalacticKittens

Get started making multiplayer games with Netcode for GameObjects
C#
196
star
16

SpaceShooterECS

The ECS project originally developed with Intel for GDC 2018
C#
151
star
17

HDRP-Defender-Character-Demo

TressFX Hair plugin (Beta), Character Package, and Hairstyles assets for HDRP
C#
122
star
18

DOTS_Pong

This project is a simple creation of the classic Pong game with a DOTS implementation. The focus was on simplicity and using the latest entities syntax (as of 2019.3 beta and Entities 0.3.0-preview.4).
C#
119
star
19

ProceduralPatterns2D

C#
112
star
20

2D_IsoTilemaps

C#
87
star
21

Pre-Baked-360

Making high quality levels for mobile platform using 360 videos and images. feel free to use it by all means.
C#
81
star
22

UniteNow20-Persistent-Data

Example Scripts for the UniteNow 2020 Persistent Data talk
C#
69
star
23

Lightmapper-FPSSample-TheInspection

C#
48
star
24

PrefabWorkflows_3DGameKit

Demo Project showing the new Prefab Workflows: Prefab Mode, Editing and Nesting!
ShaderLab
35
star
25

PrefabWorkflows_SpiderRobots

Demo Project showing the new Prefab Workflows: Prefab Mode, Editing and Nesting!
C#
33
star
26

UniteNow20-RuntimeProfiler

Example scripts from the UniteNow2020 Persistent Data talk
C#
30
star
27

ParticleFeatures_2018.3

C#
30
star
28

NavMesh-Feature-Demo

The NavMesh demo for the new Unity 5.6 Navigation Features. This is the project that was used at GDC as well as Unite AMS
C#
27
star
29

Substacnce-Painter-To-Unity

C#
22
star
30

PrefabWorkflows_UIDemo

ShaderLab
20
star
31

blockyourfriends

C#
17
star
32

Unity-Entities-Dodge-the-Bullets

Unity Korea Entities(ECS) tutorial project
ShaderLab
15
star
33

AR_Industrial

AR Foundation project showing off functionality for HoloLens 2 and mobile
ShaderLab
12
star
34

PiXYZWorkShop

C#
10
star
35

BuffaloKing

Buffalo King is a Slot Machine game (demo) showcasing 2D animation and rigging workflows.
ShaderLab
9
star
36

ShaderGraph_HDRPNodes

C#
8
star
37

2D_RiggedCharacters

5
star
38

LightingWorkshop

C#
5
star
39

TankDotsWorkshop

Project used for the Unite India workshop on DOTS, similar to the one delivered at Unite CPH.
C#
4
star
40

ARFarm

ARFarm
Mask
3
star
41

SpriteRigging_ToonCharacters

2
star
42

Unity-KOR-Uday-Entities-Sample

Very Simple Sample for Unity Korea Uday - Let's dive into Entities session
Mathematica
2
star
43

DCC-RoundTripping

Digital Content Creation and round-tripping between Autodesk 3DS Max, Autodesk Maya and Unity.
C#
1
star
44

letsdev_ep1

C#
1
star
45

TooTooBaby-CartoonsUsingUnity

I will walk through how to make a cartoon show in Unity #UnityForFilm
1
star