Skip to content

Instantly share code, notes, and snippets.

@jean-moreno
jean-moreno / pillar_shader.shader
Created November 3, 2017 07:42
Quick shader with animatable emission color based on a specific texture (red = mask, green = animation)
Shader "Custom/pillar_shader"
{
Properties
{
_Color ("Color", Color) = (1,1,1,1)
_MainTex ("Albedo (RGB)", 2D) = "white" {}
_Glossiness ("Smoothness", Range(0,1)) = 0.5
_Metallic ("Metallic", Range(0,1)) = 0.0
[Space]
_EmissionTex ("Emission", 2D) = "white" {}
@jean-moreno
jean-moreno / TextureCombiner.cs
Last active September 8, 2023 17:28
Texture Combiner utility for Unity: create an RGBA texture from 4 different input textures (note: place both files in an Editor folder)
using UnityEngine;
using UnityEditor;
using System.Collections.Generic;
public class TextureCombiner : EditorWindow
{
[MenuItem("Tools/Texture Combiner...")]
static void Open()
{
var w = GetWindow<TextureCombiner>(true, "Texture Combiner");
@jean-moreno
jean-moreno / ConsoleHijacker.cs
Last active November 29, 2022 13:49
Hack Unity Console GUI
using System;
using System.Reflection;
using UnityEditor;
using UnityEngine;
public class ConsoleHijacker
{
static readonly Type editorWindowDelegate = typeof(EditorWindow).Assembly.GetType("UnityEditor.HostView+EditorWindowDelegate");
static readonly Font monospaceFont = Font.CreateDynamicFontFromOSFont("Source Code Pro", 12);
static object internalOnGuiDelegate;