Initial commit
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.TestTools;
|
||||
|
||||
namespace BracerLib.Editor.Utility
|
||||
{
|
||||
[ExcludeFromCoverage]
|
||||
public static class TextureUtility
|
||||
{
|
||||
public static Texture2D MakeTexture(int width, int height, Color color)
|
||||
{
|
||||
var pixels = new Color[width * height];
|
||||
for (var i = 0; i < pixels.Length; i++)
|
||||
pixels[i] = color;
|
||||
var tex = new Texture2D(width, height);
|
||||
tex.SetPixels(pixels);
|
||||
tex.Apply();
|
||||
|
||||
return tex;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user