|
Post by niuage on Jan 21, 2023 15:32:12 GMT
Hi Is there no way to use SimpleSQL in a ScriptableObject without having to provide a reference to a monobehavior (the db manager)? It'd be quite practical to be able to just link the DB to a ScriptableObject, and then instantiate a manager, and from there, be able to query etc. Why does the manager need to be a monobehavior, as opposed to a pure class? Is it just to take advantage of the lifecycle hooks like start/enable etc? I can just make a script that provides the db manager to the scriptable object in question, but it feels like a workaround. Thanks!
|
|
|
Post by echo17 on Jan 22, 2023 10:32:19 GMT
I designed SimpleSQL to use the unity model of components to be as familiar and drag and drop as possible for unity users of all experience levels. My goal was to have a simple solution that would not take very much work to get up and running. For more advanced users, I figured they could just modify the source code (which is provided) to whatever suits their needs.
Hope that answers the question!
|
|
|
Post by niuage on Jan 22, 2023 20:03:48 GMT
It does thank you I think it would be a nice update to provide a standalone way to perform queries via a scriptableobject or any other pure class, but obviously, up to you. I simply created a monobehaviour that I put on the db manager game object. It gets the db manager component and provides it to my DB scriptableobject. This way I can have access to it from anywhere. That's easy enough. For some reason I thought I didnt have access to the code and it was all in dlls, but if I do, then I can take a look at what the db manager component does and probably use that. Being able to tweak the code from a package is nice but also has sometimes the big drawback of causing issues when the packages changes.
|
|
|
Post by echo17 on Jan 23, 2023 10:55:26 GMT
The plug-in is compiled DLL files, but I include the source code as a zipped up package. To modify, you will have to unzip the package make your modifications, then compile and update the DLL files. The reason that the plug-in is compiled is so that I can do clever extraction of packages when different options are selected from the tools menu. This cuts down on how much the user hast to move in and out of the project. Please see this FAQ for more information: link
|
|