Latest Posts

Go On :: editor tool :: sprite to UV's

I often find myself in need of a simple 3d quad that displays a texture from a sprite sheet. Unfortunately if you use an actual Unity Sprite you are going run into weird batching and drawcall issues in 3d. On top of that Sprites have very specialized shaders. first a word of caution The context here is important. This post describes a script that will take a Material and customize it for a sprite...

Read More »

invoke a method from a Unity Inspector

In a rush? Grab the code off of GitHub Have you ever wanted to call a method on one of your MonoBehaviours right from the editor? There are plenty ways to do this. You could make your own custom editor and add buttons in an OnInspectorGUI. This is recommended but annoying for one-offs. You could use my handy 5 minute custom editor. There is probably an asset store asset that is more robust tha...

Read More »

'enforcing' a Type in the Unity Editor

Let's start with a picture Download the code here what's going on here? There are two property fields that accept any MonoBehaviour. Both properties are decorated with an attribute that accepts a type (in this case an interface) as a parameter. If you populate the properties with an object that does not implement said type, the field will turn red. why not make the property an interface? This is a...

Read More »