LoadSceneAdditive

From Unify Community Wiki
Jump to: navigation, search

Found this in forums, added a little extra. Copies one scene into another. Originally by cyb3rmaniak and kino, thanks guys.

@MenuItem("File/Load Scene [Additive]") 
static function Apply () 
{ 
	var strScenePath : String = AssetDatabase.GetAssetPath(Selection.activeObject); 
	if (strScenePath == null) 
	{
		EditorUtility.DisplayDialog("Select Scene", "You Must Select a Scene first!", "Ok"); 
		return; 
	} 
	if (!strScenePath.Contains(".unity"))
	{
		EditorUtility.DisplayDialog("Select Scene","You Must Select a SCENE first, you selected "+strScenePath, "Ok"); 
		return; 
	}
 
	Debug.Log("Opening " + strScenePath + " additively"); 
	EditorApplication.OpenSceneAdditive(strScenePath); 
	return; 
}
Personal tools
Namespaces

Variants
Actions
Navigation
Extras
Toolbox