Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Unity Re-Save All Scenes
using System;
using System.IO;
using UnityEngine;
using UnityEditor;
using System.Collections;
public class EditorSceneHelpers
{
[MenuItem("Aztez/Resave All Scenes")]
public static void ResaveScenes()
{
String[] allFiles = Directory.GetFiles(
Path.Combine(Application.dataPath, "Build Structure"), "*.unity", SearchOption.AllDirectories
);
for (int i=0; i<allFiles.Length; ++i)
{
allFiles[i] = "Assets" + allFiles[i].Replace(Application.dataPath, "");
}
foreach(var file in allFiles)
{
EditorApplication.OpenScene(file);
EditorApplication.SaveScene();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.