#Baker - Using 'DependsOn' [SOLVED]

1 messages · Page 1 of 1 (latest)

mystic quiver
#

I'm using a Baker which pulls in and iterates over a bunch of GameObjects and ScriptableObjects which are stored inside a 'master' ScriptableObject - however i've noticed that the Subscene will not rebake/reimport if i make any changes for example to one of my ScriptableObjects..

I've tried passing this 'master' scriptable to DependsOn() as shown below, which should track and trigger a rebake if that asset changes. But it's not doing that so my question is - would i have to add DependsOn for every asset that is pulled in from this master scriptable object, or should i expect it to track all fields that are referenced?

rustic quiver
#

if i make any changes for example to one of my ScriptableObjects..
you can't just make changes for SO you need to actually save the changes to disk

#

as far as I can tell,
bakers run in a separate process and don't have access to the cache the editor has

#

this actually causes ab it of a problem because your editor SO will have different values to the baker SO unless you save them to disk

mystic quiver
#

hmm, trying to wrap my head around this

rustic quiver
#

make changes to SO, hit save

#

does it rebake?

#

(mine does)

mystic quiver
#

so for example, if i change one of my Unit scriptables, like here for example, add or remove a weapon, the baker doesn't rebake:

mystic quiver
#

no apparently not

rustic quiver
#

so you made a change on

#

saved, and it didn't rebake?

#

you didn't change an asset it was referencing, you changed the actual AssetDatabase

mystic quiver
#

ah, no i changed an asset it was referencing

rustic quiver
#

you'd need to mark that as depends on as well

mystic quiver
#

so that's kind of my question - should i expect it to track all assets referenced in fields of the asset i've marked as depends on, or will i have to mark all of those individually

rustic quiver
#
            {
                PlayerCommands = baker.DependsOn(this.playerCommands),
                NetworkPacket = baker.DependsOn(this.networkPacket),
                LoadMaxDistance = this.loadMaxDistance,
                UnloadMaxDistance = this.unloadMaxDistance,
                Relevance = this.relevance,
            });```
#

Depends on conveniently returns itself so you can kind of just insert it in wherever you use it

mystic quiver
#

ahhhhh okay, that's useful

#

yeah that's good to know, thanks

#

it would be nice if it did track these dependencies automatically tbf