Package Package { get; set; }

book_4_sparkGenerated
code_blocksInput

Description

The Package property of the MapClass class indicates the package from which the entity originates. This property is useful for identifying the source package of a particular entity within the map editor, allowing developers to manage and organize their assets effectively.

Usage

To access the package information of a MapClass instance, simply use the Package property. This property is read-only and provides a Sandbox.Package object that contains details about the package.

Example

// Example of accessing the Package property
Editor.MapClass mapEntity = new Editor.MapClass();
Sandbox.Package entityPackage = mapEntity.Package;

// Use the package information
string packageName = entityPackage.Name;
// Output the package name
// Note: Avoid using Console.WriteLine in s&box
// Instead, use in-game UI or logging systems to display information