How to copy whole asset import settings from texture and apply to another texture?

I want to copy texture import settings to another via editor code.
Is it possible?

@unity_iogames You can also simply use EditorUtility.CopySerialized(sourceTxImporter, destinationTxImporter) if there’s nothing particular you need to skip over. (Also, if it’s easier for you, you can just copy the meta files directly on the file system).

  1. Use TextureImporter.GetAtPath(string) to get the importers of source and target textures.
  2. Use new SerializedObject(YourImporter) to get the SerializedObjects of source and target.
  3. Iterator all the source SerizlizedObjcet by SerializedObject.GetIterator() and SerializedProperty.Next().
  4. Copy the every property from source to target by SerializedObject.CopyFromSerializedProperty()
  5. SerializedObject.ApplyModifiedProperties()

You may want ignore some properties when you tried this out.