Created
October 30, 2014 05:15
-
-
Save mwegner/e44ab074279625e3f84a to your computer and use it in GitHub Desktop.
Unity Re-Save All Scenes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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