I'm wondering if it's possible to change the position of mesh vertices in the editor. Here's my current code:
function OnSceneGUI()
{
var mesh : Mesh = target.GetComponent(MeshFilter).mesh;
var verts = mesh.vertices;
for (var v in verts)
v = v + Handles.PositionHandle( target.transform.position + v,
Quaternion.identity );
mesh.vertices = verts;
}
Unity complains: "Instantiating mesh due to calling MeshFilter.mesh during edit mode. This will leak meshes. Please use MeshFilter.sharedMesh instead." But using sharedMesh wouldn't make a lot of sense, either.
Actually you do have to do what Unity says and use sharedMesh. Otherwise, as it says, you'd leak meshes since they would only exist in the scene and not the project. Here is an editor script that makes custom planes, which uses sharedMesh. If it needs to be unique you can make a new mesh.