void ObjectMesherGUI(MegaRopeObjectMesher om) { bool changed = GUI.changed; GUI.changed = false; om.numframes = EditorGUILayout.IntField("Num Frames", om.numframes); GameObject src = (GameObject)EditorGUILayout.ObjectField("Source", om.source, typeof(GameObject), true); if (src != om.source) { om.source = src; om.Rebuild((MegaRope)target); } om.meshaxis = (MegaAxis)EditorGUILayout.EnumPopup("Axis", om.meshaxis); om.stretchtofit = EditorGUILayout.Toggle("Stretch", om.stretchtofit); om.scale = EditorGUILayout.Vector3Field("Scale", om.scale); if (GUI.changed) { //if ( !Application.isPlaying ) // om.Rebuild((MegaRope)target); EditorUtility.SetDirty(target); } GUI.changed = changed; }
void ObjectMesherGUI(MegaRopeObjectMesher om) { bool changed = GUI.changed; GUI.changed = false; om.numframes = EditorGUILayout.IntField("Num Frames", om.numframes); GameObject src = (GameObject)EditorGUILayout.ObjectField("Source", om.source, typeof(GameObject), true); if ( src != om.source ) { om.source = src; om.Rebuild((MegaRope)target); } om.meshaxis = (MegaAxis)EditorGUILayout.EnumPopup("Axis", om.meshaxis); om.stretchtofit = EditorGUILayout.Toggle("Stretch", om.stretchtofit); om.scale = EditorGUILayout.Vector3Field("Scale", om.scale); if ( GUI.changed ) { //if ( !Application.isPlaying ) // om.Rebuild((MegaRope)target); EditorUtility.SetDirty(target); } GUI.changed = changed; }