public void DoDrawTextureCircle(Texture2D tex, int cx, int cy, int r, Color col)
{
//Color32 _col = (Color32)col;
int x, y, px, nx, py, ny, d;
// Color32[] tempArray = tex.GetPixels32();
for (x = 0; x <= r; x++)
{
d = (int)Mathf.Ceil(Mathf.Sqrt(r * r - x * x));
for (y = 0; y <= d; y++)
{
px = cx + x;
nx = cx - x;
py = cy + y;
ny = cy - y;
tex.SetPixel(px, py, col);
tex.SetPixel(nx, py, col);
tex.SetPixel(px, ny, col);
tex.SetPixel(nx, ny, col);
// tempArray[py*1024 + px] = _col;
// tempArray[py*1024 + nx] = _col;
// tempArray[ny*1024 + px] = _col;
// tempArray[ny*1024 + nx] = _col;
}
}
// tex.SetPixels32(tempArray);
tex.Apply ();
}