protected override void OnDisable()
{
base.OnDisable();
if (!EditorApplication.isPlaying && !InternalEditorUtility.ignoreInspectorChanges && this.m_MightHaveModified)
{
this.m_MightHaveModified = false;
string[] array = new string[base.targets.GetLength(0)];
int num = 0;
UnityEngine.Object[] targets = base.targets;
for (int i = 0; i < targets.Length; i++)
{
ProceduralTexture proceduralTexture = (ProceduralTexture)targets[i];
string assetPath = AssetDatabase.GetAssetPath(proceduralTexture);
SubstanceImporter substanceImporter = AssetImporter.GetAtPath(assetPath) as SubstanceImporter;
if (substanceImporter)
{
substanceImporter.OnTextureInformationsChanged(proceduralTexture);
}
assetPath = AssetDatabase.GetAssetPath(proceduralTexture.GetProceduralMaterial());
bool flag = false;
for (int j = 0; j < num; j++)
{
if (array[j] == assetPath)
{
flag = true;
break;
}
}
if (!flag)
{
array[num++] = assetPath;
}
}
for (int k = 0; k < num; k++)
{
SubstanceImporter substanceImporter2 = AssetImporter.GetAtPath(array[k]) as SubstanceImporter;
if (substanceImporter2 && EditorUtility.IsDirty(substanceImporter2.GetInstanceID()))
{
AssetDatabase.ImportAsset(array[k], ImportAssetOptions.ForceUncompressedImport);
}
}
}
}