public override void OnInspectorGUI() { serializedObject.Update(); ShapeKeyMorphSO morph = (ShapeKeyMorphSO)serializedObject.targetObject; Mesh m = (Mesh)m_propMesh.objectReferenceValue; EditorGUILayout.BeginHorizontal(); { GUILayout.Label("Morph Name:"); GUILayout.Space(20f); string morphName = m_propName.stringValue; if (EUtil.StringField("MorphName", ref morphName)) { m_propName.stringValue = morphName; _ChangeAssetNameIfNeeded(); } } EditorGUILayout.EndHorizontal(); EditorGUILayout.ObjectField(new GUIContent("Working Mesh", "The mesh on which this morph is applied"), m, typeof(Mesh), true); EditorGUILayout.HelpBox( string.Format("vertex: {0}, {1}, {2}", m.vertexCount, morph.HasNormals ? "normals" : "NO normals", morph.HasTangents ? "tangents" : "NO tangents"), MessageType.Info); // show each shapeKeyData for (int i = 0; i < morph.ShapeKeyCnt; ++i) { _DrawShapeKeyData(morph, i); } // add new shapeKeyData button GUILayout.BeginHorizontal(); { GUILayout.Space(30f); if (GUILayout.Button("Add New Shape Key")) { Undo.RecordObject(morph, "ShapeKeyMorphSO inspector"); morph.AddNewShapeKeyByMeshCurrentData(); } GUILayout.Space(30f); } GUILayout.EndHorizontal(); serializedObject.ApplyModifiedProperties(); }