How can I change sprite texture color use c#?
When click left button of mouse at game screen.I want to change sprite texture color at mouse position extend to a square; I confussed how use mouse position to get sprite texture position. Can I used sprite texture position to change color? like image mouse click on black point position and change some range color Thanks for the help!
擷取.png
(2.5 kB)
Comment
Sprite spriteImage= Resources.Load ("Image");
Color spritepixel;
spritepixel = spriteImage.texture.GetPixel (positionX, positionY);
spritepixel = spriteImage.texture.SetPixel (1, 1, Color.Red);
I think maybe I can use this to change color.
But I don't know how to convert mouse position to texture position?