Skip to main content

PackageManager

A static class in Root.Township, Alta.Loot.

Static lookup of DebugPackage assets (from Resources/Items/Packages/) and the code behind the package drop console command. Server only.

Fields​

1 private and internal field
MemberWhat it is
private static Dictionary<string, DebugPackage> packageMapBacking field for PackageMap.

Properties​

MemberWhat it is
static Dictionary<string, DebugPackage> PackageMap { get; }Packages by lower-case name with spaces removed. Loaded on first access.

Methods​

MemberWhat it is
static bool DropPackage(string packageName, Player player = null, params string[] arguments)Server: spawns the named package 2 m in front of the player's head, or at the original spawn point if no player. Name match ignores case and spaces.
3 private and internal methods
MemberWhat it is
private static void ApplyArguments(NetworkEntity entity, string[] arguments)Passes spawn arguments to every ISpawnArguments component on an entity. Private and never called.
private static IEnumerator DelayedSpawn(DebugPackage package, Func<Vector3> getPosition, string[] arguments) (iterator)Coroutine that spawns each prefab in a package. Stackables spawn as one pouch; others spawn one at a time 0.1 s apart, without the arguments.
private static void SetupPackages()Loads every DebugPackage from Resources/Items/Packages/ into packageMap.