I've made a custom editor for my scriptable objects where I save Server and Client parts separately but can edit both together. I've currently made it so that any changes must be made in this editor window and cant be made in the SO. My concern is someone accidently deleting the SO in the project files whilst forgetting about its counterpart. Is there a way to prevent SO deletion in project files? or somehow connect the 2 SO's together so that if one is deleted the other is automatically deleted as well?
Hope you can help!
#Scriptable Objects Lock
1 messages · Page 1 of 1 (latest)
the simplest solution would probably be to make one a sub asset of the other (or both subassets of some "config" SO)
Yea that makes sense, Thanks!
Wait no, but if I delete the config in the project folder the sub assets wont get deleted. And I need the sub assets to be seperate SO's in order to use addressables and load the correct data for server and client
? subassets of a deleted asset will be deleted too. I'm not saying serialized references, but actual subassets https://docs.unity3d.com/ScriptReference/AssetDatabase.AddObjectToAsset.html
I'm not sure about the addressables part though
I'll need to experiment. Thanks!
Just to confirm, Subassets can't be seperated in Addressables unfortunatley. Trying to figure out a work around atm
I've instead got Chatgpt to create a look up function that checks if there is any ID in the client addressable that isnt in the server adressables and deletes it when the editor is opened. Works for now, I hope it scales well