// Unity
using UnityEngine;
namespace GUPS.AntiCheat.Editor.Helper
{
///
/// A helper class for creating textures.
///
public static class TextureHelper
{
///
/// Creates a texture with the given width, height and color.
///
/// The width of the texture.
/// The height of the texture.
/// The color of the texture.
/// Returns the created texture.
public static Texture2D MakeTexture(int _Width, int _Height, Color _Color)
{
Color[] pix = new Color[_Width * _Height];
for (int i = 0; i < pix.Length; i++)
pix[i] = _Color;
Texture2D result = new Texture2D(_Width, _Height, TextureFormat.ARGB32, false);
result.SetPixels(pix);
result.Apply();
return result;
}
}
}