言語: 日本語
  • C#
  • JS
  • Boo

スクリプト言語

お好みのスクリプト言語を選択すると、サンプルコードがその言語で表示されます。

EditorApplication.OpenSceneAdditive

public static function OpenSceneAdditive(path: string): void;

Description

シーンファイルのパスを指定して現在のシーンに加算ロードを行います

全てのパスは "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); 
	}