Making an online game where players can customise their clothes.
I instantiate the template Spine character, and attempting to just change this instantiation's renderer texture with SetPixels() however this always seems to not change anything, or change all instantiations depending on how I attempt to clone the Texture2D.
I figured I should be doing something like this to get a unique texture for each instance:
Texture2D newTex = Texture2D.Instantiate (renderer.material.mainTexture) as Texture2D;
newTex.SetPixels(colors);
GetComponent<MeshRenderer>().material.mainTexture = newTex;
Each player should have a unique atlas texture for their set of clothes they have equipped.
Is something in SkeletonRenderer forcing the material to be shared between all instantiations?
(Note: I must use SetPixels and modify the atlas texture and not Sprite Attachments due to the way the resource images for the equipment are set up on the web server. )