A small entity component system utility to manage unmanaged memory
Reactive Disposal is a small utility to help manage unmanaged/unsafe memory in Unity’s Entity Component System. This
takes advantage of ISystemStateComponentData
alongside IComponentData
on unmanaged memory.
For the difference between the two, please take a look com.unity.entities@0.0/manual/system_state_components.html">here.
Because ISystemStateComponentData
have different lifetimes compared to IComponentData
, all unmanaged memory must be
disposed manually.
While it is completely possible to store unmanaged memory in MonoBehaviour
s, this greatly couples the use of objects
with something that is honestly just pure data. This also makes the project very messy as objects which can be converted
and destroyed into their entity format, are now injected and persistent thus taking up more memory within the game.
Simply clone this project as a submodule into your git repository.
git submodule add https://github.com/InitialPrefabs/ReactiveDisposal.git <path-to-desired-directory>
Add this line to Packages/manifest.json
"com.initialprefabs.reactive-disposal": "git://github.com/InitialPrefabs/ReactiveDisposal.git"
Jump over to the wiki for more detailed info!