public override void Apply() { if (Tex == null) { return; } Tex.Apply(); }
public void SetPixelByPos(Color32 color, Vector2 pos) { Vector2 pixelCoordinate = GetPixelCoordinate(pos); if (pixelCoordinate == new Vector2(-1, -1)) { return; } Undo.RecordObject(Tex, "ColorPixel"); Tex.SetPixel((int)pixelCoordinate.x, (int)pixelCoordinate.y, color); Tex.filterMode = FilterMode.Point; Tex.Apply(); }