using UnityEngine; using UnityEditor; using NaughtyAttributes; #if UNITY_EDITOR public class Painter : MonoBehaviour { // public Texture3D texture; // public Color left, right, bottom, top, back, front; // [Button] // void LoadTexture() // { // left = texture.GetPixel(0, 1, 1); // right = texture.GetPixel(2, 1, 1); // bottom = texture.GetPixel(1, 0, 1); // top = texture.GetPixel(1, 2, 1); // back = texture.GetPixel(1, 1, 0); // front = texture.GetPixel(1, 1, 2); // } // [Button] // void UpdateTexture() // { // texture.SetPixel(0, 1, 1, left); // texture.SetPixel(2, 1, 1, right); // texture.SetPixel(1, 0, 1, bottom); // texture.SetPixel(1, 2, 1, top); // texture.SetPixel(1, 1, 0, back); // texture.SetPixel(1, 1, 2, front); // texture.Apply(); // AssetDatabase.CreateAsset(texture, "Assets/Materials/" + texture.name + ".asset"); // } // [Button] // public void NewTexture() // { // // 3D texture for normal indexed colors // Texture3D normalColors = new Texture3D(3, 3, 3, TextureFormat.RGBA32, false); // normalColors.filterMode = FilterMode.Point; // normalColors.wrapMode = TextureWrapMode.Clamp; // normalColors.anisoLevel = 0; // Color[] colorArray = new Color[3 * 3 * 3]; // colorArray[4] = Color.blue; // Back // colorArray[22] = Color.blue; // Forward // colorArray[10] = Color.green; // Down // colorArray[16] = Color.green; // Up // colorArray[12] = Color.red; // Left // colorArray[14] = Color.red; // Right // normalColors.SetPixels(colorArray); // normalColors.Apply(); // AssetDatabase.CreateAsset(normalColors, "Assets/Materials/newTex.asset"); // } } #endif