22 lines
544 B
C#
22 lines
544 B
C#
|
|
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;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|