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 »

Go On :: emissive textures and atlases

What a small technique for such a great effect. The image shows each model with and without the emissive layer. Note the how the red lens of the camera model is all lit up. Since I'm finally using textures instead of solid colors, I decided to upgrade the models to incorporate an emissive layer (they are robots after all). The shaders have been upgraded to support this. multiplicity But now there...

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 »

saving binary data in Parse

I happen to use Parse as a Cloud datastore and highly recommend it if you want to bootstrap a feature or app quickly. The goal for this post is to offer an example of how to work with parse to store any serializable type. Farther down I will briefly explain a few benefits of this approach, but I will leave some of that to a future post. key points We will be subclassing ParseObject. This will add...

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 »