Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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

This comment has been minimized.

Copy link

albertoxamin commented Jul 2, 2014

Whoa it looks intresting!

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.