#It is and each field has SerializeField

1 messages ยท Page 1 of 1 (latest)

queen aurora
#

Which classes are scriptable objects and which ones are not?

gritty wind
#

Item is a ScriptableObject, the ItemComponents are not.

tidal epoch
#

You cannot serialize derived class type with Unity unless you use editor script, that's the thing

gritty wind
#

So I'd need to make the ItemComponents themselves also ScriptableObjects?

queen aurora
#

that would work, but it sounds pretty gnarly to me

tidal epoch
#

That, or just make Item as prefab and add components on it ๐Ÿ™‚

gritty wind
#

I'd rather not overhaul it as such.

#

However I agree on the topic of it being gnarly to extend from SO.

queen aurora
#

you can have the object be a prefab and never instantiate it and it would work pretty similarly

gritty wind
#

That doesn't sound too far away from just extending SO then

#

In terms of gnarly, I mean

tidal epoch
#

That's also why we don't use SO. Impossible to refactor anything ๐Ÿ˜Œ

queen aurora
#

rather than needing to create a separate asset file for them

#

and you're going to need to write those classes somewhere, so just making them extend MonoBehavior isn't really a big deal

#

you can also use a custom inspector for your original design to work

gritty wind
queen aurora
#

with true as the 2nd argument?

gritty wind
#

Un moment

#

I've been using PropertyDrawers, not a CustomEditor

#

I have two currently, one for Equip and one for Weapon components.

#

Do I need to make one that handles the base class and have it try handling the rest of the types?

queen aurora
#

honestly, its been a long time since I've done custom editor work. I don't know the answer off the top of my head

#

I'm looking at the docs to try to get a sense

tidal epoch
#

Most importantly you need [SerializedReference]

gritty wind
tidal epoch
queen aurora
tidal epoch
#

You still need custom editor script

#

I'm sure there is some generic open source thing for this

#

I'd recommend just change it to prefab based and be less messy

#

Really you shouldn't afraid to refactor your things

gritty wind
queen aurora
gritty wind
#

Would that solve the others also not showing up?

#

Or would I still need a custom one for the rest?

queen aurora
#

I think just the one on the base class might do it

#

give it a shot

gritty wind
#

Fair enough, thanks!