Create a gist now

Instantly share code, notes, and snippets.

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.

Show comment Hide comment
@albertoxamin

albertoxamin Jul 2, 2014

Whoa it looks intresting!

Whoa it looks intresting!

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