Instantly share code, notes, and snippets.

View MeshInspector.cs
// author: Stijn Raaijmakers (@bugshake)
// date: 11 sep 2016
using UnityEngine;
#if UNITY_EDITOR
using UnityEditor;
#endif
/// <summary>Add this component to any GameObject with a MeshFilter, then select it in the editor</summary>
public class MeshInspector : MonoBehaviour
View ReadableID
public static class ReadableID
{
static readonly string[] syllables = new string[256];
public static void initOnce()
{
string[] consonants = new string[] { "b", "br", "c", "ch", "d", "f", "fr", "g", "h", "j", "k", "kn", "l", "m", "n", "p", "pr", "qu", "r", "s", "st", "sl", "sc", "t", "tr", "v", "w", "x", "z" };
string[] vowels = new string[] { "a", "e", "i", "o", "u", "y", "ae", "ee", "ea", "ai" };
for (int i = 0; i < syllables.Length; ++i)
{
View RigidbodyInspector.cs
using UnityEngine;
using UnityEditor;
[CustomEditor(typeof(Rigidbody))]
public class RigidBodyInspector : Editor
{
public override void OnInspectorGUI()
{
Rigidbody target = (Rigidbody)this.target;
if (DrawDefaultInspector())
View ObservableProperty.cs
// get an event when a property changes
public class ObservableProperty<T>
{
T value;
public delegate void ChangeEvent(T data);
public event ChangeEvent changed;
public ObservableProperty(T initialValue)
{
View Screenshotter.cs
using System;
using System.IO;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;
using UnityEditor;
/*
AUTHOR: Stijn Raaijmakers @bugshake
View SortedGizmos.cs
using System;
using System.Collections.Generic;
using UnityEngine;
public static class SortedGizmos
{
static List<ICommand> commands = new List<ICommand>(1000);
public static Color color { get; set; }