[Muli-Skin] dynamically build Texture2Ds #7
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is still a WIP
I have all the code working to allow for swapping of equipment and base skins. The developer can customize it any which way by creating a single "regions" JSON file (see attached). This is just a bunch of named rectangles, like "helmet" and "face" in the attached example. Then, the developer can use the new "Creature Material Packer" script I built by assigning a default material, an array of skins, and the regions JSON file. Finally, when the developer wants to actually swap something, it's as simple as SetAttachment("helmet", "Equip_Silver") or SetAttachment("face", "Skin_Pale") to continue with our example.

I optimized the code a bit so it always does incremental asset-building. That is: it caches the last texture for any given Creature, only edits the texture when something changes, and does so incrementally such that it only copies the changed asset. I've got it building for iOS and so far the performance looks good. I tested this by having it swap the helmet between bronze & silver every 0.2 seconds in order to simulate a player rapidly equipping and unequipping items.
