KospY / BasSDK

Official SDK for the VR game "Blade & Sorcery"
https://store.steampowered.com/app/629730/Blade_and_Sorcery
114 stars 67 forks source link

Add a non Odin Editor based Catalog Editor #62

Closed loukylor closed 1 month ago

loukylor commented 12 months ago

Adds an editor that allows the user to edit catalog files that aren't in the BuildStaging folder using a nice UI. Most importantly, it doesn't rely on Odin Editor and uses Unity UI methods only. image

A few data classes needed the SerializeReference and Serializable attributes added, however they are only needed in editor and a preprocessor command was included to make sure they aren't compiled out of editor.

Wully616 commented 12 months ago

When opening the editor tool it hangs.

looking at the code it is trying to read every single file in the Application.dataPath. I am not sure why it is looking there. Applidation.dataPath points to the BasSDK\Assets folder in the project.

I've got lots of assets and stuff in my SDK project, so it searching through every file to find any json files is very inefficient

We keep all of the CatalogDatas in BasSDK\BuildStaging\Catalogs anyway.

image

I would recommending looking at our existing tool for loading the CatalogDatas under ThunderRoad (SDK)/Load All JSON. You can just call that to load all the json, then you can read the Categories and the data in the catalog in the Catalog.data

loukylor commented 12 months ago

I've changed it to grab and save files to BuildStaging/Mods rather than Assets, and optimized rendering performance when handling a lot of files as per our discussion on Discord. However, I still insist on deserializing and loading files using my own implementation due to the merging issue I brought up. I understand this is unideal, but will work.