Created
August 9, 2013 10:03
-
-
Save AngryAnt/6192566 to your computer and use it in GitHub Desktop.
This utility lets you easily combine two scenes into one.
This file contains 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 UnityEngine; | |
using UnityEditor; | |
using System.IO; | |
public class MultiScene | |
{ | |
[MenuItem ("File/Combine Scenes")] | |
static void Combine () | |
{ | |
Object[] objects = Selection.objects; | |
EditorApplication.SaveCurrentSceneIfUserWantsTo (); | |
EditorApplication.NewScene (); | |
foreach (Object item in objects) | |
{ | |
EditorApplication.OpenSceneAdditive (AssetDatabase.GetAssetPath (item)); | |
} | |
} | |
[MenuItem ("File/Combine Scenes", true)] | |
static bool CanCombine () | |
{ | |
if (Selection.objects.Length < 2) | |
{ | |
return false; | |
} | |
foreach (Object item in Selection.objects) | |
{ | |
if (!Path.GetExtension (AssetDatabase.GetAssetPath (item)).ToLower ().Equals (".unity")) | |
{ | |
return false; | |
} | |
} | |
return true; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Whoa it looks intresting!