Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Returns of a solid texture of width * height of color 'color'
- private Texture2D MakeTextureColor(int width, int height, Color color)
- {
- // Create an array to contain all of our pixels
- Color[] pixels = new Color[width * height];
- // Set each pixel to our color
- for (int i = 0; i < pixels.Length; i++) {
- pixels [i] = color;
- }
- // Apply the color to the texture
- Texture2D output = new Texture2D (width, height);
- output.SetPixels (pixels);
- output.Apply ();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement