static void MenuItemSaveScenePrefabs()
        {
            SceneManager sceneManager = (SceneManager)Object.FindObjectOfType(typeof(SceneManager));

            if (sceneManager == null)
            {
                Debug.LogWarning("Could not find SceneManager in the scene! Make sure to add a SceneManager component to a game component in your scene.");
            }
            else
            {
                SceneManagerEditor.SaveAllScenePrefabs(sceneManager);
            }
        }
        public static string[] OnWillSaveAssets(string[] paths)
        {
            foreach (string path in paths)
            {
                if (path.EndsWith(".unity"))
                {
                    AssetDatabase.LoadAssetAtPath <Object>(path);
                    SceneManager manager = Object.FindObjectOfType <SceneManager>();
                    if (manager != null)
                    {
                        SceneManagerEditor.SaveAllScenePrefabs(manager);
                    }
                }
            }

            return(paths);
        }