Skip to content

Instantly share code, notes, and snippets.

View daniel-ilett's full-sized avatar
🦆

Daniel Ilett daniel-ilett

🦆
View GitHub Profile
@daniel-ilett
daniel-ilett / GradientWindow.cs
Created April 8, 2020 00:41
A Unity editor script which lets you save a Gradient as a texture file (place the script inside a folder named Editor).
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using System.IO;
public class GradientWindow : EditorWindow
{
private Gradient gradient = new Gradient();
private int resolution = 256;
@daniel-ilett
daniel-ilett / TriangleTexturePlugin.cs
Created April 27, 2024 17:48
A Unity editor script which takes a mesh and generates a texture based on the UVs where each triangle is assigned a random greyscale color (place the script inside a folder named Editor).
#if UNITY_EDITOR
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UIElements;
using UnityEditor;
using UnityEditor.UIElements;
// Based on: https://forum.unity.com/threads/save-rendertexture-or-texture2d-as-image-file-utility.1325130/
public class TriangleTexturePluginWindow : EditorWindow