Code save cc.Asset or Global Object in Editor

Hello,

I have a need to have a list of all keys used in components of the same type placed on different prefabs. I have considered several implementation methods, but unfortunately, all of them have encountered some issues. Solving any of these issues would allow me to achieve the desired logic:

  1. Modifying and saving changes through code in base assets like cc.Prefab or cc.JsonAsset. If these changes are made now, they happen in a file that’s stored in operative memory.
  2. A savable global object. Currently, all changes to global objects are reset upon cocos reload/scene transition.
  3. Creating a dynamically changing Enum, which isn’t updated upon page reload.

Also, within the scope of these questions, there are inquiries about working with Custom cc.Asset. If there’s any information available on working with them, I’d greatly appreciate it. Thank you:)

I’m trying to address these issues in CocosCreator 2.4.11. This solution is needed for a more accurate interaction with the editor.

I think Custom Asset would be what you need, unfortunately this wasn’t available in v2, Prefab only stores the data while you editing it inside prefab, change to global object won’t be serialized, you can only use LocalStorage to save and reload manually. I didn’t understand the dynamic Enum part

Custom Asset will work, but it will not be possible to view it in the editor, alas.
You can resave any assets using Editor.assetdb or Editor.Ipc. If you do not know what to look for, then it is not possible to find it in the documentation. It is generally impossible to find complete data about a message in Editor.Ipc.