LoadSceneAdditive

From Unify Community Wiki
(Difference between revisions)
Jump to: navigation, search
(added script)
 
m (Text replace - "<javascript>" to "<syntaxhighlight lang="javascript">")
Line 1: Line 1:
 
Found this in forums, added a little extra. Copies one scene into another. Originally by cyb3rmaniak and kino, thanks guys.
 
Found this in forums, added a little extra. Copies one scene into another. Originally by cyb3rmaniak and kino, thanks guys.
  
<javascript>
+
<syntaxhighlight lang="javascript">
 
@MenuItem("File/Load Scene [Additive]")  
 
@MenuItem("File/Load Scene [Additive]")  
 
static function Apply ()  
 
static function Apply ()  

Revision as of 20:48, 10 January 2012

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; 
}
</javascript>
Personal tools
Namespaces

Variants
Actions
Navigation
Extras
Toolbox