Create a gist now

Instantly share code, notes, and snippets.

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

Whoa it looks intresting!

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