Coder Social home page Coder Social logo

hosseinpan / so-architecture-boilerplate Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 1.0 36 KB

A boilerplate for creating modular architectures using Scriptable Objects in Unity projects.

License: MIT License

C# 100.00%
unity csharp architecture scriptableobject statemachine objectpooling eventsystem

so-architecture-boilerplate's Introduction

SO-Architecture-Boilerplate

Unity code architecture boilerplate based on the Ryan Hipple's 2017 Unite talk

Features

  • ScriptableObject Categories
    • Events
    • Managers
    • SharedData
      • Variables
      • Lists
  • CommonSO
  • StateMachine
  • Object Pooling

Event System

It uses C# events instead of unity events.

CommonSO

CommonSO tries to solve these problems:

  • Each ScriptableObject can have dozens of references in the scenes, which increases the likelihood of human error.
  • Debugging and tracking all the references of a ScriptableObject is difficult.
  • Whenever we change the name of a ScriptableObject, we need to reassign it to all references in all scenes.

CommonSO is a singleton prefab that serves as a single source of the ScriptableObjects in a scene. When referencing ScriptableObjects, MonoBehaviours should use CommonSO. It is a good practice to map CommonSO names and structures to your Scriptable Object assets folder.

StateMachine

There are two types of transition conditions:

  • Event List Condition: We provide a list of VoidEventSO as a condition for transition of a state. The condition is met when all the events are raised after entering the state.
  • Statement Condition: We provide a Func as condition.

Object Pooling

It lives in ScriptableObjects > Managers folder. All GameObjects can be pooled into it.

Examples

The usage of all features is demonstrated in the Example folder.

so-architecture-boilerplate's People

Contributors

hosseinpan avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

babak-ss

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.