static Task LoadEntitiesFromPackage( Package package )

book_4_sparkGenerated
code_blocksInput

Description

The LoadEntitiesFromPackage method is a static method of the Editor.GameData class. It is used to load entities from a specified Sandbox.Package into the game data. This method is essential for integrating new entities from packages into the editor environment, allowing tools to access and manipulate these entities.

Usage

To use the LoadEntitiesFromPackage method, you need to pass a Sandbox.Package object as a parameter. This package should contain the entities you wish to load into the editor. The method returns a System.Threading.Tasks.Task, indicating that it is asynchronous and can be awaited.

Example

// Example of using LoadEntitiesFromPackage
public async Task LoadPackageEntitiesAsync(Sandbox.Package package)
{
    await Editor.GameData.LoadEntitiesFromPackage(package);
    // After loading, you can access the loaded entities via Editor.GameData.EntityClasses
}