internal void SaveChangesToAsset() { Debug.Assert(importedAsset != null); // Update JSON. var asset = m_AssetObjectForEditing; m_ImportedAssetJson = asset.ToJson(); // Write out, if changed. var assetPath = path; var existingJson = File.ReadAllText(assetPath); if (m_ImportedAssetJson != existingJson) { EditorHelpers.CheckOut(assetPath); File.WriteAllText(assetPath, m_ImportedAssetJson); AssetDatabase.ImportAsset(assetPath); } m_IsDirty = false; onDirtyChanged(false); }