Accessing Unity 3.4 gizmos through code.

Hey guys,

As you all might know Unity 3.4 comes with new and improved Editor Gizmo stuff. This has some pretty nice features, that for instance in two clicks let you set up a nice colored label gizmo above your Game Object.

But how do you do this through code? I’ve looked through all the new documentation and can’t find anything about this. Am I correct that it can’t be done? That would render it useless for anything but prefabs…

What I want to be able to do is

var myNewGO : GameObject = new GameObject();
myNewGO.thisNewGizmoStuff.label.enabled;
myNewGo.thisnewGizmoStuff.label.color = Color.yellow;

The same as creating an empty Game Object in the editor, going through it’s inspector, clicking the new gizmo tool and clicking the yellow label. Please tell me this is possible…?

Regards,
Joshua.

I just replaced my gizmo code with the new API (which is to say, I deleted it). So you could do the reverse: don’t assign it with the editor feature, and use the old fashioned DrawGizmo stuff to do it in code.