private static void OnWillSaveAssets(string[] assets, out string[] assetsThatShouldBeSaved, out string[] assetsThatShouldBeReverted, int explicitlySaveScene)
{
assetsThatShouldBeReverted = new string[0];
assetsThatShouldBeSaved = assets;
bool flag = assets.Length > 0 && EditorPrefs.GetBool("VerifySavingAssets", false) && InternalEditorUtility.isHumanControllingUs;
if (explicitlySaveScene != 0 && assets.Length == 1 && assets[0].EndsWith(".unity"))
{
flag = false;
}
if (flag)
{
AssetSaveDialog.ShowWindow(assets, out assetsThatShouldBeSaved);
}
else
{
assetsThatShouldBeSaved = assets;
}
foreach (Type current in AssetModificationProcessorInternal.AssetModificationProcessors)
{
MethodInfo method = current.GetMethod("OnWillSaveAssets", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic);
if (method != null)
{
object[] array = new object[]
{
assetsThatShouldBeSaved
};
if (AssetModificationProcessorInternal.CheckArguments(array, method))
{
string[] array2 = (string[])method.Invoke(null, array);
if (array2 != null)
{
assetsThatShouldBeSaved = array2;
}
}
}
}
if (assetsThatShouldBeSaved == null)
{
return;
}
List <string> list = new List <string>();
string[] array3 = assetsThatShouldBeSaved;
for (int i = 0; i < array3.Length; i++)
{
string text = array3[i];
if (!AssetDatabase.IsOpenForEdit(text))
{
list.Add(text);
}
}
assets = list.ToArray();
if (assets.Length != 0 && !Provider.PromptAndCheckoutIfNeeded(assets, string.Empty))
{
Debug.LogError("Could not check out the following files in version control before saving: " + string.Join(", ", assets));
assetsThatShouldBeSaved = new string[0];
return;
}
}