Legacy Documentation: Version 4.5.0

Script language:

  • JS
  • C#
  • Boo
Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

Application.LoadLevelAdditive

static function LoadLevelAdditive(index: int): void;
static void LoadLevelAdditive(int index);
static def LoadLevelAdditive(index as int) as void
static function LoadLevelAdditive(name: string): void;
static void LoadLevelAdditive(string name);
static def LoadLevelAdditive(name as string) as void

Description

Loads a level additively.

Unlike LoadLevel, LoadLevelAdditive does not destroy objects in the current level. Objects from the new level are added to the current scene. This is useful for creating continuous virtual worlds, where more content is loaded in as you walk through the environment.

	// Loads the level with index 1
	Application.LoadLevel (1);

// Add items from the level named "MoreStuff". Application.LoadLevelAdditive ("MoreStuff");

using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour {
    void Example() {
        Application.LoadLevel(1);
        Application.LoadLevelAdditive("MoreStuff");
    }
}
import UnityEngine
import System.Collections

public class ExampleClass(MonoBehaviour):

	def Example() as void:
		Application.LoadLevel(1)
		Application.LoadLevelAdditive('MoreStuff')