unity-atoms/README.md

116 lines
5.9 KiB
Markdown
Raw Normal View History

2018-10-30 15:05:06 -04:00
# ⚛️ Unity Atoms
2020-04-03 10:01:05 -04:00
[![openupm](https://img.shields.io/npm/v/com.mambojambostudios.unity-atoms-core?label=core&registry_uri=https://package.openupm.com)](https://openupm.com/packages/com.mambojambostudios.unity-atoms-core/)
[![openupm](https://img.shields.io/npm/v/com.mambojambostudios.unity-atoms-base-atoms?label=base-atoms&registry_uri=https://package.openupm.com)](https://openupm.com/packages/com.mambojambostudios.unity-atoms-base-atoms/)
[![openupm](https://img.shields.io/npm/v/com.mambojambostudios.unity-atoms-fsm?label=fsm&registry_uri=https://package.openupm.com)](https://openupm.com/packages/com.mambojambostudios.unity-atoms-fsm/)
[![openupm](https://img.shields.io/npm/v/com.mambojambostudios.unity-atoms-mobile?label=mobile&registry_uri=https://package.openupm.com)](https://openupm.com/packages/com.mambojambostudios.unity-atoms-mobile/)
[![openupm](https://img.shields.io/npm/v/com.mambojambostudios.unity-atoms-mono-hooks?label=mono-hooks&registry_uri=https://package.openupm.com)](https://openupm.com/packages/com.mambojambostudios.unity-atoms-mono-hooks/)
[![openupm](https://img.shields.io/npm/v/com.mambojambostudios.unity-atoms-tags?label=tags&registry_uri=https://package.openupm.com)](https://openupm.com/packages/com.mambojambostudios.unity-atoms-tags/)
[![openupm](https://img.shields.io/npm/v/com.mambojambostudios.unity-atoms-scene-mgmt?label=scene-mgmt&registry_uri=https://package.openupm.com)](https://openupm.com/packages/com.mambojambostudios.unity-atoms-scene-mgmt/)
[![openupm](https://img.shields.io/npm/v/com.mambojambostudios.unity-atoms-ui?label=ui&registry_uri=https://package.openupm.com)](https://openupm.com/packages/com.mambojambostudios.unity-atoms-ui/)
2019-10-03 17:05:26 -04:00
_Tiny modular pieces utilizing the power of Scriptable Objects_
2018-11-16 06:49:57 -05:00
2018-10-30 15:55:37 -04:00
## Influences
2019-10-03 17:05:26 -04:00
2019-11-28 13:35:59 -05:00
Unity Atoms is derived from and a continuation of Ryan Hipple's [talk](https://www.youtube.com/watch?v=raQ3iHhE_Kk&t=2787s) from Unite 2017. The original source code can be found [here](https://github.com/roboryantron/Unite2017).
2018-10-30 15:05:06 -04:00
[This](https://www.youtube.com/watch?v=6vmRwLYWNRo&t=738s) talk by Richard Fine is a forerunner to Ryan Hipple's talk during Unite 2016.
2018-10-30 15:05:06 -04:00
2018-10-30 15:55:37 -04:00
## Motivation
2019-10-03 17:05:26 -04:00
The general approach to building scripts in Unity often generates a code base that is monolithic. This results in that your code is cumbersome to test, non-modular and hard to debug and understand.
2019-10-03 17:05:26 -04:00
Unity Atoms is an open source library that aims to make your game code:
2019-10-03 17:05:26 -04:00
- 📦 Modular _- avoid scripts and systems directly dependent on each other_
- ✏️ Editable _- Scriptable Objects makes it possible to make changes to your game at runtime_
- 🐛 Debuggable _- modular code is easier to debug than tightly coupled code_
2019-04-05 09:22:33 -04:00
## Installation
### NPM
2019-10-03 17:05:26 -04:00
_Prerequisite: Since Unity Atoms is using the Unity Package Manager (UPM) you need to use Unity version 2018.3 >=_
Add the following to your `manifest.json` (which is located under your project location in the folder `Packages`):
2019-10-03 17:05:26 -04:00
```
{
"scopedRegistries": [
{
"name": "NPM Registry",
"url": "https://registry.npmjs.org",
"scopes": [
"com.mambojambostudios.unity-atoms-core",
2020-03-01 20:26:06 -05:00
"com.mambojambostudios.unity-atoms-base-atoms",
2020-03-21 19:15:03 -04:00
"com.mambojambostudios.unity-atoms-fsm",
2019-10-03 17:05:26 -04:00
"com.mambojambostudios.unity-atoms-mobile",
2019-10-15 19:43:51 -04:00
"com.mambojambostudios.unity-atoms-mono-hooks",
2019-10-03 17:05:26 -04:00
"com.mambojambostudios.unity-atoms-tags",
"com.mambojambostudios.unity-atoms-scene-mgmt",
"com.mambojambostudios.unity-atoms-ui"
]
}
],
"dependencies": {
Squashed commit of the following: commit 847eff037204d841546c0da772d2f341f9cf1e25 Author: Adam Ramberg <andersson.adam.89@gmail.com> Date: Sun Mar 17 22:09:38 2019 +0100 #17 - Serializable not needed for ScriptableObject commit 593b275e6394b9d589de8a7a20375145dfc4aa84 Author: Adam Ramberg <andersson.adam.89@gmail.com> Date: Sun Mar 17 21:59:33 2019 +0100 18 - IGameEvent<T1, T2> RegisterListener commit 40443ce9bd4b1c339aaf19cfcb119f2336608dae Author: Adam Ramberg <andersson.adam.89@gmail.com> Date: Fri Mar 8 16:35:04 2019 +0100 Remove some more warnings commit bd453110ac51a6ebe3d54368fcb039bdbe52e278 Author: Adam Ramberg <andersson.adam.89@gmail.com> Date: Fri Mar 8 16:33:30 2019 +0100 Update README commit 90977b853a047c84efb5311768a09f4e8a1165b2 Author: Adam Ramberg <andersson.adam.89@gmail.com> Date: Fri Mar 8 16:31:45 2019 +0100 Initialize to null to get rid off warnings commit 38b7f5c4ede195aa7198f567801c9cbeedc9b6f6 Author: Adam Ramberg <andersson.adam.89@gmail.com> Date: Fri Mar 8 16:15:53 2019 +0100 More fixes to enable local unity project commit 404e1cbf88ed4431c61d3ece074e838e74ac5141 Author: Adam Ramberg <andersson.adam.89@gmail.com> Date: Fri Mar 8 16:12:37 2019 +0100 Remove duplicated asmdef commit 5734300684e8a16553f213157cad1b4722b7cb7f Author: Adam Ramberg <andersson.adam.89@gmail.com> Date: Fri Mar 8 16:09:46 2019 +0100 Change files to include commit d1e42b119a6bc1577b1792459fa298e063652337 Author: Adam Ramberg <andersson.adam.89@gmail.com> Date: Fri Mar 8 16:05:56 2019 +0100 Added root package json commit 1709a0347147d74460f653182bbaf8d15eb6154e Author: Adam Ramberg <andersson.adam.89@gmail.com> Date: Fri Mar 8 15:30:44 2019 +0100 #16 - Add test and examples Unity project commit a3ea1a133bf6727e011ba85c64569db45302e487 Author: Adam Ramberg <andersson.adam.89@gmail.com> Date: Fri Mar 8 13:12:02 2019 +0100 #13 - Make usage of UPM (package manager) commit 492a30e905f6cf3f5899cb7080ef2bda73110f00 Author: Adam Ramberg <andersson.adam.89@gmail.com> Date: Fri Mar 8 11:28:56 2019 +0100 Added extensions + code formatting fixes commit 709949a1016c236cfd363cf25392fedfd8d083ca Author: Oliver Biwer <soraphis@users.noreply.github.com> Date: Fri Mar 8 10:16:45 2019 +0100 More AtomicTags changes (#15) * - added assembly defintions, and unit tests - improved AtomicTags in regards of #8, #9 and #10 * Fixes #11 - Added Equality Members (inclusive HashCode) for ScriptableObjectVariableBase * removed Rider Plugins from git * Further AtomicTag optimization commit ae6584c879f182e727fe0a8d0aff4b0715829914 Author: Adam Ramberg <andersson.adam.89@gmail.com> Date: Fri Mar 8 10:08:36 2019 +0100 Editor config commit 197d7067608600e4e2d13dc42db909ee8f8c75df Author: Adam Ramberg <andersson.adam.89@gmail.com> Date: Fri Mar 8 09:23:12 2019 +0100 Added editor config file commit 53d6adc07bbc2967c12c17227a1c31d9f1cfba77 Author: Oliver Biwer <soraphis@users.noreply.github.com> Date: Tue Mar 5 22:57:47 2019 +0100 More efficient AtomicTags (#12) * - added assembly defintions, and unit tests - improved AtomicTags in regards of #8, #9 and #10 * Fixes #11 - Added Equality Members (inclusive HashCode) for ScriptableObjectVariableBase * removed Rider Plugins from git commit 81209d83b5195300d4c2d54411cff3c7983f0d97 Author: Adam Ramberg <andersson.adam.89@gmail.com> Date: Wed Dec 12 20:54:17 2018 +0100 Added MonoHooks + ColliderType + bug fixes commit c6b240cebbdc410341fb05204235842df5da9d73 Author: Adam Ramberg <andersson.adam.89@gmail.com> Date: Sat Dec 1 00:23:10 2018 +0100 Experimenting with adding UI state management commit dfd70a8944acbeabe5feba1cf6cff2be6802c470 Author: Adam Ramberg <andersson.adam.89@gmail.com> Date: Fri Nov 30 23:10:21 2018 +0100 Issue #6 - AtomicTags commit 8907763227f4d4c2a32c5684e7caa4d4a082eb16 Author: Adam Ramberg <andersson.adam.89@gmail.com> Date: Fri Nov 30 22:42:29 2018 +0100 First commit of v1.0.0
2019-03-17 18:43:20 -04:00
...
2020-08-03 19:57:39 -04:00
"com.mambojambostudios.unity-atoms-core": "4.3.0",
"com.mambojambostudios.unity-atoms-base-atoms": "4.3.0",
"com.mambojambostudios.unity-atoms-fsm": "4.3.0",
"com.mambojambostudios.unity-atoms-mobile": "4.3.0",
"com.mambojambostudios.unity-atoms-mono-hooks": "4.3.0",
"com.mambojambostudios.unity-atoms-tags": "4.3.0",
"com.mambojambostudios.unity-atoms-scene-mgmt": "4.3.0",
"com.mambojambostudios.unity-atoms-ui": "4.3.0",
2019-04-05 09:22:33 -04:00
...
2019-10-03 17:05:26 -04:00
}
}
```
2018-10-30 16:23:40 -04:00
2020-03-01 20:26:06 -05:00
Note that the core and base atoms packages are mandatory while the others are optional. If you don't want a subpackage, simply remove it from your `dependencies`.
2018-10-30 16:23:40 -04:00
### OpenUPM
The package is available on the [openupm registry](https://openupm.com). It's recommended to install it via [openupm-cli](https://github.com/openupm/openupm-cli).
```
# required
openupm add com.mambojambostudios.unity-atoms-core
2020-03-21 19:15:03 -04:00
openupm add com.mambojambostudios.unity-atoms-base-atoms
# optional
2020-03-21 19:15:03 -04:00
openupm add com.mambojambostudios.unity-atoms-fsm
openupm add com.mambojambostudios.unity-atoms-mobile
openupm add com.mambojambostudios.unity-atoms-mono-hooks
openupm add com.mambojambostudios.unity-atoms-tags
openupm add com.mambojambostudios.unity-atoms-scene-mgmt
openupm add com.mambojambostudios.unity-atoms-ui
```
2019-10-03 17:05:26 -04:00
## Documentation
2018-10-30 15:55:37 -04:00
2019-10-03 17:05:26 -04:00
The Unity Atoms docs are now published at **https://adamramberg.github.io/unity-atoms**.
2018-10-30 15:55:37 -04:00
2020-03-02 14:17:45 -05:00
### Blog posts
- [Unity Atoms — Tiny modular pieces utilizing the power of Scriptable Objects](https://medium.com/@adamramberg/unity-atoms-tiny-modular-pieces-utilizing-the-power-of-scriptable-objects-e8add1b95201)
- [Announcing Unity Atoms v2](https://medium.com/@adamramberg/announcing-unity-atoms-v2-1719ef3e587e)
2020-03-22 18:59:18 -04:00
- [Unity Atoms v4 is out!](https://medium.com/@adamramberg/unity-atoms-v4-is-out-b15a37da49da)
2020-03-02 14:17:45 -05:00
2019-10-03 17:05:26 -04:00
## How does it work?
2019-10-03 17:05:26 -04:00
Read [this](https://medium.com/@adamramberg/unity-atoms-tiny-modular-pieces-utilizing-the-power-of-scriptable-objects-e8add1b95201) article on Medium for a great introduction to Unity Atoms.
2019-10-17 07:02:04 -04:00
2019-11-03 11:50:45 -05:00
## Looking for support?
For questions and support please join our [Discord channel](https://discord.gg/W4yd7E7).
2019-10-18 11:37:12 -04:00
## Maintainers
2019-10-17 07:02:04 -04:00
- [AdamRamberg](https://github.com/AdamRamberg)
- [soraphis](https://github.com/soraphis)
2020-08-24 04:20:38 -04:00
- [miikalo](https://github.com/miikalo)
2019-10-17 07:02:04 -04:00
We are looking for more people to join the team! Contact us if you want to jump aboard.