lobibeam.blogg.se

Color unity art
Color unity art









color unity art

Would it be better to just use a shader? Otherwise, wouldn't I have to create a unique texture anyway- so either way I have to do an extra draw call? Or can I have character prefabs which each have the Character_SpriteSheet.png unity sprite, and with read/write enabled I can edit one character without also changing the colors on another instantiated prefab, which uses the exact same unity sprite?Ĭlick to expand.Shader language looks like gibberish to me, and I didn't want to mess with shaders since I already knew how to do it this way. When instantiated, the character's hair color is given as a parameter during instantiation, with a result like.Īll sharing the exact same texture2D sprite sheet, "Assets\Graphics\Character_SpriteSheet.png" Something like, the original image has pure green (Color 0,255,0) for the hair pixels. If I mark it as "Read/Write Enabled", then won't it change the actual texture file in the asset folder? Permanently change it?Īll characters use the same sprite sheet (Sprite, Sprite Mode: Multiple) but each individual character in the game needs to have different colors for certain pixels. So the characters never change color except when they're being created. As I said before, I simply did everything through simple getPixel(), setPixel() functions and a few loops when dealing with the image in memory.Īll of it is done before gameplay begins, or before a character is instantiated. I would appreciate any advice as to what is the best or easiest way to do this would be. All characters used the same sprite, but different coloring of that one sprite. The reason I copied the images before changing them was so that ALL characters wouldn't change when ONE was colored a certain way. In this way, I could have multiple characters who all look different. In C#, I simply took the image from memory, made a copy of it, dyed the character to the correct colors, and then displayed the image as a sprite. So the texture looks funny, with pure red/green/blue/yellow/etc. This 40x40 sprite is very simple and pixelated. I have one 40x40 pixel sprite which is used for all characters, but the player gets to choose the color of their skin, the color of their shirt, and color of their hair.

color unity art

I am used to dealing in just 2D and with much lower level programming, so forgive my newbie Unity question.











Color unity art