{"id":18233,"library":"com.fluid.database","title":"Fluid Database","description":"A Unity package providing a simple key-value pair database supporting int, float, string, and bool types, with extensibility to custom types via generics. Current stable version is 2.1.0 (released 2021-01-05). The package is installed via Unity's Package Manager from the npm registry under the com.fluid scope. It uses Unity Events for change notifications and includes a global bool monitor component. Compared to PlayerPrefs or scriptable objects, Fluid Database offers type safety, a generic API, and editor integration.","status":"maintenance","version":"2.1.0","language":"javascript","source_language":"en","source_url":"https://github.com/ashblue/fluid-database","tags":["javascript","unity package manager","unity3d","database","upm"],"install":[{"cmd":"npm install com.fluid.database","lang":"bash","label":"npm"},{"cmd":"yarn add com.fluid.database","lang":"bash","label":"yarn"},{"cmd":"pnpm add com.fluid.database","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Replaced built-in events with Unity Event Plus package in v2.0.0","package":"com.fluid.unity-event-plus","optional":false}],"imports":[{"note":"Namespace is FluidDatabase, not Fluid.Database.","wrong":"using Fluid.Database;","symbol":"FluidDatabase","correct":"using FluidDatabase;"},{"note":"Types like IntDatabase inherit from ScriptableObject; should be used as assets via CreateAssetMenu.","wrong":"IntDatabase intDb = new IntDatabase();","symbol":"IntDatabase","correct":"public IntDatabase intDb = new IntDatabase();"},{"note":"Generic Database requires type parameter; custom databases must inherit from Database<T>.","wrong":"public class MyCustomDatabase : Database {}","symbol":"IDatabase<T>","correct":"public class MyCustomDatabase : Database<MyType> { }"}],"quickstart":{"code":"using FluidDatabase;\nusing UnityEngine;\n\npublic class Example : MonoBehaviour\n{\n    public IntDatabase intDb;\n\n    void Start()\n    {\n        if (intDb != null)\n        {\n            intDb.Set(\"score\", 100);\n            Debug.Log(\"Score: \" + intDb.Get<int>(\"score\", 0));\n            Debug.Log(\"Has key 'score': \" + intDb.Has(\"score\"));\n        }\n    }\n}","lang":"csharp","description":"Shows basic usage of IntDatabase: set a value, get it, and check existence."},"warnings":[{"fix":"Update event listeners to use UnityEventPlus or migrate to the new event system.","message":"In v2.0.0, events were replaced with Unity Event Plus. Existing components using built-in events will break.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Re-assign the bool values in the array field of the global bool monitor.","message":"In v2.0.0, global bool monitor component now uses array values instead of single bool. Existing monitor components will lose their value.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Add scopedRegistries entry as shown in the installation instructions.","message":"Package requires scopedRegistry configuration. Without it, Unity cannot resolve the package from npm.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Refer to the new UnityEventPlus documentation.","message":"Documentation mentions old event system that was removed in v2.0.0.","severity":"deprecated","affected_versions":">=2.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Add 'using FluidDatabase;' at top of script and ensure package is installed via package manager.","cause":"Missing using directive or package not installed.","error":"error CS0246: The type or namespace name 'FluidDatabase' could not be found"},{"fix":"Add scopedRegistry for 'com.fluid' in manifest.json.","cause":"Missing scoped registry in Packages/manifest.json.","error":"Failed to resolve package: com.fluid.database"},{"fix":"Ensure T matches the type used in Set. Prefer using typed database (e.g., IntDatabase) instead of generic <T>.","cause":"Calling Get<T> with a type different from the stored type.","error":"ArgumentException: The requested value type does not match the stored type."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}