Skip to content

Instantly share code, notes, and snippets.

@liortal53
liortal53 / DecoratorEditor.cs
Last active May 25, 2026 05:06
Extend Unity's built-in inspectors
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using UnityEditor;
using UnityEngine;
/// <summary>
/// A base class for creating editors that decorate Unity's built-in editor types.
/// </summary>
public abstract class DecoratorEditor : Editor
@stramit
stramit / SpecialEventClass.cs
Last active November 21, 2018 06:36
SpecialEventClass
/*
* When developing the UI system we came across a bunch of things we were not happy
* with with regards to how certain events and calls could be sent in a loosely coupled
* way. We had this requirement because with a UI you tend to implement widgets that receive
* certain events, but you don't really want to have lots of glue code to manage them
* and keep track of them. The eventing interfaces we developed helped with this. One of
* the interesting things, is that they are not justfor the UI system! You can use this as
* a type-safe, fast, and simple alternative to SendMessage (never use SendMessage!).
* So how does it all work?
using UnityEngine;
using UnityEditor;
using System.IO;
// example PostProcessor for adjusting automatic Sprite Import settings
// save this in any "Editor" Folder
public class SpriteImportProcessor : AssetPostprocessor
{
void OnPostprocessSprites(Texture2D texture, Sprite[] sprites)
{
@kimsama
kimsama / WebViewEditorWindow.cs
Created February 16, 2017 05:28
Open WebView window within Unity editor. It runs fine with Unity 5.5.x and no crash when closing Unity editor.
using UnityEngine;
using UnityEditor;
using System;
using System.Reflection;
/// <summary>
/// Open a webview within Unity editor. (similar as AssetStore window)
/// </summary>
public class WebViewEditorWindow : EditorWindow
{
@Democide
Democide / SkewedGridLayoutGroup.cs
Last active May 27, 2024 20:06
Skewed Grid Layout Group - Unity UI Extension
/// Skewed Grid Layout Group
/// ===============================
///
/// Written by Martin Nerurkar
/// - http://www.martin.nerurkar.de
/// - http://www.sharkbombs.com
///
/// You are free to moddify and use this code in your own projects
/// You are not allowed to remove this copyright notice
/// You are not allowed to resell this code, even if modified
@SpineyPete
SpineyPete / tonemappers.glsl
Last active July 29, 2026 09:15
Tonemappers
#version 330
// Tonemapping
// -----------
// Some of these are attributed to certain games.
// But this is mostly secondhand info, so take it with a grain of salt.
vec3 Tonemap_Reinhard(vec3 x) {
// Simplest Reinhard tonemapper.