Wearable Set Data
A pre-configured set of Wearables, Materials and Morphs.
The Wearable Set Data class holds strings and arrays containing references to the wearables, materials and cosmetics for a Wearable Set. Its’ purpose is to easily convert JSON data to and from Wearable Sets, which can be equipped to the Character.
The Modular Character Manager can export the currently equipped set to Wearable Set Data. It can also convert Wearable Set Data to a Wearable Set to be applied to the character. In this way, you can save and load a Wearable Set during Runtime.
Creating a JSON file with Wearable Set Data
If you want to be able to save a set in a build, you can do so using the SaveDataAsJSON function in the Modular Character Manager. This will save a copy of the current Wearable Set as a JSON file to the 'Saved Data' folder.
Calling the function will create Wearable Set Data generated directly from the current character configuration. This code will check your specified save location to see if a folder with the Character Style name exists. If no such folder exists, it will create one. It will then copy the current set and save it as JSON data in that location.
The saved data can be captured and loaded during Runtime using the persistent path or your own save tools.
Loading and Equipping a Wearable Set from a JSON file
You can load a JSON file containing Wearable Set Data and convert it to a Wearable Set to be equipped by calling the LoadCharacterFromJSON function from the Modular Character Manager.
Calling the function will load a JSON file, convert the Wearable Set Data to a Wearable Set, and then equip that set to the Character. You will need to pass the Modular Character Manager, a new set name, and a save location to the function.
Last updated