UnityEditor.AssetModificationProcessorInternal.OnWillSaveAssets C# (CSharp) Method

OnWillSaveAssets() private static method

private static OnWillSaveAssets ( string assets, string &assetsThatShouldBeSaved, string &assetsThatShouldBeReverted, int explicitlySaveScene ) : void
assets string
assetsThatShouldBeSaved string
assetsThatShouldBeReverted string
explicitlySaveScene int
return void
        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 type in AssetModificationProcessors)
            {
                MethodInfo method = type.GetMethod("OnWillSaveAssets", BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Static);
                if (method != null)
                {
                    object[] args = new object[] { assetsThatShouldBeSaved };
                    if (CheckArguments(args, method))
                    {
                        string[] strArray = (string[]) method.Invoke(null, args);
                        if (strArray != null)
                        {
                            assetsThatShouldBeSaved = strArray;
                        }
                    }
                }
            }
            if (assetsThatShouldBeSaved != null)
            {
                List<string> list = new List<string>();
                foreach (string str in assetsThatShouldBeSaved)
                {
                    if (!AssetDatabase.IsOpenForEdit(str))
                    {
                        list.Add(str);
                    }
                }
                assets = list.ToArray();
                if ((assets.Length != 0) && !Provider.PromptAndCheckoutIfNeeded(assets, ""))
                {
                    Debug.LogError("Could not check out the following files in version control before saving: " + string.Join(", ", assets));
                    assetsThatShouldBeSaved = new string[0];
                }
            }
        }