- Home /
Question by
JeffBC · Jan 17, 2014 at 03:07 PM ·
procedural meshmeshrenderermaterial.
Error when changing materials in the editor on a procedurally generated mesh
I'm creating a script to generate an editable procedurally generated mesh. Everything works fine as long as i don't try to change materials by draging it to the mesh. Doing that crashes the scene view, probably because the script's custom editor's OnSceneGUI() never reaches an end
Problem seems to be that dragging a material to the mesh somehow resets most values in the script handling the mesh editing (unity says that the mesh variable isn't assingned and i can't acess vertices[], which holds mesh's points), which doesn't happen if try to change the material through the mesh renderer
Is there anyway to prevnt this "resetting", or to keep materials from being changed by dragging one to the mesh?
Comment