EditorApplication.OpenSceneAdditive 打开附加路径场景

static function OpenSceneAdditive (path : string) : void

Description描述

Opens the scene at path additively.

打开在附加路径的场景。

All paths are relative to the project folder. Like: "Assets/MyScenes/MyScene.unity"

所有的路径都是相对于工程文件夹. 例如” Assets/MyScenes/MyScene.unity”

// Simple script that lets you load the contents of a selected scene
// to your current scene.
//简单的脚本,可以使你加载被选中场景内容到你当前的场景中
@MenuItem("Example/Load Scene Additive")
static function Apply () {
	var strScenePath : String = AssetDatabase.GetAssetPath(Selection.activeObject);
	if (strScenePath == null || !strScenePath.Contains(".unity")) {
		EditorUtility.DisplayDialog("Select Scene", "You Must Select a Scene!", "Ok");
		EditorApplication.Beep();
		return;
	}
	Debug.Log("Opening " + strScenePath + " additively");
	EditorApplication.OpenSceneAdditive(strScenePath);
}
Page last updated: 2011-6-25