-
Notifications
You must be signed in to change notification settings - Fork 1
KeyValueDefinitionBase non generic as new base class #24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
Created new base class for KeyValueDefinitionBase<T> in the form of KeyValueDefinitionBase. This lets all variable references be serialized in the Inspector without having to serialized ScriptableObject. Then all KeyValueDefinitions can be found in the project easily.
Hey this is super clever. I'll run it locally to regression test tonight. |
Hey can you explain the edge case this solves? It just seems like this adds an extra layer of complexity to the |
Hey,
yeh sure. Thanks for checking out my request so fast, I appreciate it. My
use case may explain it best.
I want to serialize a list of values and use them to replace certain parts
of a string. I can serialize them as Scriptable Objects fine but then the
object finder in Unity will show me all of my ScriptableObjects - not just
the variables.
I had initially just serialized the string implementation but I found I
also want to get how many of something I have, like an inventory count or
tasks left on an objective.
I tried doing some verification on the values assigned to ensure they were
the correct base type but it doesn’t stop Unity showing the full list. I
want to make this system user friendly.
This non-generic base class is a pattern I use in my work with Unity to
work around its serialising limitations.
I hope that clears it up. If I make any more requests I’ll try to be
thorough in my explanations - I did this one while under time pressure so
it’s not as clear as it can be
Thanks!
On Wed, 31 Aug 2022 at 06:12, Ash Blue ***@***.***> wrote:
Hey can you explain the edge case this solves? It just seems like this
adds an extra layer of complexity to the KeyValueDefinitionBase<T> but
I'm probably missing something. I did some checks and it seems to compile
just fine as is right now on MonoBehaviors and ScriptableObject(s) without
this fix.
—
Reply to this email directly, view it on GitHub
<#24 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACPWPMTEAIKAWORXCI6DDDV33LUPANCNFSM6AAAAAAQARVVAA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
--
-----------
Hugo Scott-Slade
|
That makes sense. I'll QA the search functionality of the type search to verify things tonight after work. Thanks for doing this. |
Might take a bit of effort to get this adjustment in but I totally see the value of it. Will eventually get in (sorry for the wait). All depends on when I have to swing in again to upgrade the database library. |
Sorry, still haven't gotten around to updating this branch. It needs some migration work to my latest package generator version. |
Created new base class for KeyValueDefinitionBase in the form of KeyValueDefinitionBase. This lets all variable references be serialized in the Inspector without having to serialized ScriptableObject.
Then all KeyValueDefinitions can be found in the project easily.