Skip to content

Instantly share code, notes, and snippets.

@AngryAnt
Created August 9, 2013 10:03
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AngryAnt/6192566 to your computer and use it in GitHub Desktop.
Save AngryAnt/6192566 to your computer and use it in GitHub Desktop.
This utility lets you easily combine two scenes into one.
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;
}
}
@albertoxamin
Copy link

Whoa it looks intresting!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment