PickupObjectDatabase pickupDatabase = PickupObjectDatabase.Instance; string encounterName = "gungeon:heart_lunchbox"; PickupObject pickupObject = pickupDatabase.GetByEncounterName(encounterName);
PickupObjectDatabase pickupDatabase = PickupObjectDatabase.Instance; ListThis code initializes the PickupObjectDatabase and retrieves a random pickup object based on its encounter name. In this case, we are retrieving a pickup object with encounter name "gun_nope". This is done by filtering the list of all pickup objects to only include those with the specified encounter name, then ordering them randomly and selecting the first item. The package library for this code is likely the Enter the Gungeon API.pickups = pickupDatabase.Objects; string encounterName = "gungeon:gun_nope"; PickupObject pickupObject = pickups .Where(p => p.encounterNameOrID == encounterName) .OrderBy(p => UnityEngine.Random.value) .FirstOrDefault();