From Unify Community Wiki
Revision as of 20:53, 14 March 2010 by Cyclops (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


This is a simple demo package that demonstrates two things: creating a fake Runtime Gizmo, and procedural creation of an in-game mesh object.

The fake Gizmo is a three-arrow axis object that can be attached to an in-Hierarchy object. By clicking on one of the arrows, the Gizmo moves itself and the parent object in that axis direction. Note - it's not mouse-draggable as such, just holding the mouse down generates the movement.

To use it, you would drag/drop the script, s_GizmoCreate.cs onto your GameObject. This script procedurally creates the actual Gizmo, which is built by two other scripts, s_Gizmo.cs and s_GizmoClick.cs.

To use the Procedural Mesh creation code, I first created an arrow in Blender, exported it to a .fbx, then wrote a Python script to convert all the vertex/triangle numbers into a C# statement like new Vector3 (0.01, 0.02, 0.03). The arrow looked fine when I imported the .fbx file straight into Unity - I'm not sure why the vertex/triangle list shows up as glitchy. :)

The Unity package can be downloaded from Media:FakeGizmoDemo.zip

What it looks like: Fakegizmodemo.jpg

Personal tools