Interestingly with that one, I think I have a good guess at what the point of it is. I imagine it's to do with layering and having certain hairstyles over or under pieces of the uniform. That said...there's got to be better ways of doing it...
The last 4 lines could be swapped out for a single 3-line for loop if you want to use an array instead of a tuple for textureOrderMap:
for (int i = 0; i < textureOrderMap.Length; i++){
this.MyRenderer.materials[i].mainTexture = textureOrderMap[i] ? femaleUniformTexture : this.HairTexture;
}
If older C# versions can only be used, the translation from the above to the older versions is trivial. I only wrote like this because I'm too lazy to use the older versions of C#.
Edit: more eye-pleasing code formatting for textureOrderMap switch.
4
u/RuneLFox Apr 10 '23
Interestingly with that one, I think I have a good guess at what the point of it is. I imagine it's to do with layering and having certain hairstyles over or under pieces of the uniform. That said...there's got to be better ways of doing it...