Source Code : 
public static void DrawRectangle(Rect rectColor colorfloat alpha 0f)
{
    
Texture2D texture = new Texture2D(11);
    
color.alpha;
    
texture.SetPixel(00color);
    
texture.wrapMode TextureWrapMode.Repeat;
    
texture.Apply();

[Login or Register to remove this advertisement]

    
GUI.DrawTexture(recttexture);

Xcode Reviewed by Xcode on . Rectangle with alpha (Unity) public static void DrawRectangle(Rect rect, Color color, float alpha = 0f) { Texture2D texture = new Texture2D(1, 1); color.a = alpha; texture.SetPixel(0, 0, color); texture.wrapMode = TextureWrapMode.Repeat; texture.Apply(); GUI.DrawTexture(rect, texture); } Rating: 5