/// <summary> /// Draws line on texture /// </summary> public static void DrawLine(this Texture2D texture, int x0, int y0, int x1, int y1, Color color) { if (texture == null) { throw new ArgumentNullException("texture"); } Draw.RasterLine(x0, y0, x1, y1, (x, y) => texture.SetPixel(x, y, color)); }
/// <summary> /// Draws line on texture /// </summary> public static void DrawLine(this Texture2D texture, Vector2Int v0, Vector2Int v1, Color color) { if (texture == null) { throw new ArgumentNullException("texture"); } Draw.RasterLine(v0, v1, (x, y) => texture.SetPixel(x, y, color)); }
/// <summary> /// Draws a line on pixels /// </summary> public static void DrawLine(this Color[] pixels, int textureWidth, int x0, int y0, int x1, int y1, Color color) { if (pixels == null) { throw new ArgumentNullException(nameof(pixels)); } Draw.RasterLine(x0, y0, x1, y1, (x, y) => pixels[x + y * textureWidth] = color); }
/// <summary> /// Draws a line on pixels /// </summary> public static void DrawLine(this Color[] pixels, int textureWidth, Vector2Int v0, Vector2Int v1, Color color) { if (pixels == null) { throw new ArgumentNullException(nameof(pixels)); } Draw.RasterLine(v0, v1, (x, y) => pixels[x + y * textureWidth] = color); }
/// <summary> /// Draws line on texture /// </summary> public static void DrawLine(this Texture2D texture, int x0, int y0, int x1, int y1, Color color) { Draw.RasterLine(x0, y0, x1, y1, (x, y) => texture.SetPixel(x, y, color)); }
/// <summary> /// Draws line on texture /// </summary> public static void DrawLine(this Texture2D texture, Vector2Int v0, Vector2Int v1, Color color) { Draw.RasterLine(v0, v1, (x, y) => texture.SetPixel(x, y, color)); }