public override void OnInspectorGUI() { SceneSerializerTransform data = target as SceneSerializerTransform; data.isLocal = EditorGUILayout.Toggle("local", data.isLocal); data.persistent = EditorGUILayout.Toggle("persistent", data.persistent); data.positionFlags = (SceneSerializerTransform.Axis)EditorGUILayout.EnumMaskField("position", data.positionFlags); data.rotationFlags = (SceneSerializerTransform.Axis)EditorGUILayout.EnumMaskField("rotation", data.rotationFlags); if (GUI.changed) { EditorUtility.SetDirty(data); } }
public override void OnInspectorGUI() { SceneSerializerTransform data = target as SceneSerializerTransform; EditorGUI.BeginChangeCheck(); var isLocal = EditorGUILayout.Toggle("local", data.isLocal); var positionFlags = (SceneSerializerTransform.Axis)EditorGUILayout.EnumFlagsField("position", data.positionFlags); var rotationFlags = (SceneSerializerTransform.Axis)EditorGUILayout.EnumFlagsField("rotation", data.rotationFlags); if (EditorGUI.EndChangeCheck()) { Undo.RecordObject(target, "Change Scene Serializer"); data.isLocal = isLocal; data.positionFlags = positionFlags; data.rotationFlags = rotationFlags; } }