Class Pickup
A wrapper class for InventorySystem.Items.Pickups.ItemPickupBase.
Inheritance
Inherited Members
Namespace: Exiled.API.Features.Pickups
Assembly: Exiled.API.dll
Syntax
public class Pickup : TypeCastObject<Pickup>, IWrapper<ItemPickupBase>, IWorldSpace, IPosition, IRotation
Properties
| Improve this Doc View SourceBase
Gets or sets the InventorySystem.Items.ItemBase of the item.
Declaration
public ItemPickupBase Base { get; protected set; }
Property Value
| Type | Description |
|---|---|
| InventorySystem.Items.Pickups.ItemPickupBase |
GameObject
Gets the UnityEngine.GameObject of the Pickup.
Declaration
public GameObject GameObject { get; }
Property Value
| Type | Description |
|---|---|
| UnityEngine.GameObject |
Info
Gets or sets the pickup information.
Declaration
public PickupSyncInfo Info { get; set; }
Property Value
| Type | Description |
|---|---|
| InventorySystem.Items.Pickups.PickupSyncInfo |
InUse
Gets or sets a value indicating whether the pickup is currently in use.
Declaration
public bool InUse { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
IsLocked
Gets or sets a value indicating whether the pickup is locked (can't be picked up).
Declaration
public bool IsLocked { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
IsSpawned
Gets a value indicating whether this pickup is spawned.
Declaration
public bool IsSpawned { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
List
Declaration
public static IEnumerable<Pickup> List { get; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<Pickup> |
PhysicsModule
Gets or sets the pickup's PhysicsModule.
Declaration
public PickupStandardPhysics PhysicsModule { get; set; }
Property Value
| Type | Description |
|---|---|
| InventorySystem.Items.Pickups.PickupStandardPhysics |
PickupTime
Gets or sets the amount of time it takes to pick up this item, based on Weight.
Declaration
public float PickupTime { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Single |
Remarks
Notes: Changing this value will change the item's Weight. This does not account for status effects such as Hypothermia; see PickupTimeForPlayer(Player) to account for status effects.
See Also
| Improve this Doc View SourcePosition
Gets or sets the pickup position.
Declaration
public Vector3 Position { get; set; }
Property Value
| Type | Description |
|---|---|
| UnityEngine.Vector3 |
See Also
| Improve this Doc View SourcePreviousOwner
Gets or sets the previous owner of this item.
Declaration
public Player PreviousOwner { get; set; }
Property Value
| Type | Description |
|---|---|
| Player |
See Also
| Improve this Doc View SourceRelativePosition
Gets or sets the relative position of the pickup.
Declaration
public RelativePosition RelativePosition { get; set; }
Property Value
| Type | Description |
|---|---|
| RelativePositioning.RelativePosition |
Rigidbody
Gets the UnityEngine.Rigidbody of the Pickup.
Declaration
public Rigidbody Rigidbody { get; }
Property Value
| Type | Description |
|---|---|
| UnityEngine.Rigidbody |
Room
Gets the current Room the Pickup is in.
Declaration
public Room Room { get; }
Property Value
| Type | Description |
|---|---|
| Room |
Rotation
Gets or sets the pickup rotation.
Declaration
public Quaternion Rotation { get; set; }
Property Value
| Type | Description |
|---|---|
| UnityEngine.Quaternion |
See Also
| Improve this Doc View SourceScale
Gets or sets the pickup's scale value.
Declaration
public Vector3 Scale { get; set; }
Property Value
| Type | Description |
|---|---|
| UnityEngine.Vector3 |
Serial
Gets or sets the unique serial number for the item.
Declaration
public ushort Serial { get; set; }
Property Value
| Type | Description |
|---|---|
| System.UInt16 |
Transform
Gets the UnityEngine.Transform of the Pickup.
Declaration
public Transform Transform { get; }
Property Value
| Type | Description |
|---|---|
| UnityEngine.Transform |
Type
Gets the ItemType of the item.
Declaration
public ItemType Type { get; }
Property Value
| Type | Description |
|---|---|
| ItemType |
Weight
Gets or sets the weight of the item.
Declaration
public float Weight { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Single |
See Also
Methods
| Improve this Doc View SourceClone()
Clones the current pickup with a different serial.
Declaration
public virtual Pickup Clone()
Returns
| Type | Description |
|---|---|
| Pickup | Cloned pickup object. |
Create(ItemType)
Creates and returns a new Pickup with the proper inherited subclass.
Based on the type, the returned Pickup can be cast into a subclass to gain more control over the object.
- All valid ammo should be cast to the AmmoPickup class.
- All valid firearms (not including the Micro HID) should be cast to the FirearmPickup class.
- All valid keycards should be cast to the KeycardPickup class.
- All valid armor should be cast to the BodyArmorPickup class.
- All grenades and throwables (not including SCP-018 and SCP-2176) should be cast to the GrenadePickup class.
The following have their own respective classes:
- Radios can be cast to RadioPickup.
- The Micro HID can be cast to MicroHIDPickup.
- SCP-244 A and B variants can be cast to Scp244Pickup.
- SCP-330 can be cast to Scp330Pickup.
- SCP-018 can be cast to Scp018Projectile.
- SCP-2176 can be cast to Scp2176Projectile.
Items that are not listed above do not have a subclass, and can only use the base Pickup class.
Declaration
public static Pickup Create(ItemType type)
Parameters
| Type | Name | Description |
|---|---|---|
| ItemType | type | The ItemType of the pickup. |
Returns
| Type | Description |
|---|---|
| Pickup | The created Pickup. |
See Also
| Improve this Doc View SourceCreateAndSpawn(ItemType, Vector3, Quaternion, Player)
Creates and spawns a Pickup.
Declaration
public static Pickup CreateAndSpawn(ItemType type, Vector3 position, Quaternion rotation, Player previousOwner = null)
Parameters
| Type | Name | Description |
|---|---|---|
| ItemType | type | The ItemType of the pickup. |
| UnityEngine.Vector3 | position | The position to spawn the Pickup at. |
| UnityEngine.Quaternion | rotation | The rotation to spawn the Pickup. |
| Player | previousOwner | An optional previous owner of the item. |
Returns
| Type | Description |
|---|---|
| Pickup | The Pickup. See documentation of Create(ItemType) for more information on casting. |
See Also
Destroy()
Destroys the already spawned pickup.
Declaration
public void Destroy()
See Also
| Improve this Doc View SourceGet(ItemPickupBase)
Gets an existing Pickup or creates a new instance of one.
Declaration
public static Pickup Get(ItemPickupBase pickupBase)
Parameters
| Type | Name | Description |
|---|---|---|
| InventorySystem.Items.Pickups.ItemPickupBase | pickupBase | The InventorySystem.Items.Pickups.ItemPickupBase to convert into a Pickup. |
Returns
| Type | Description |
|---|---|
| Pickup | The Pickup wrapper for the given InventorySystem.Items.Pickups.ItemPickupBase. |
Get(ItemType)
Gets an System.Collections.Generic.IEnumerable<T> of Pickup containing all existing InventorySystem.Items.Pickups.ItemPickupBase instances given an ItemType.
Declaration
public static IEnumerable<Pickup> Get(ItemType type)
Parameters
| Type | Name | Description |
|---|---|---|
| ItemType | type | The ItemType to look for. |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<Pickup> | An System.Collections.Generic.IEnumerable<T> of Pickup containing all existing InventorySystem.Items.Pickups.ItemPickupBase instances. |
See Also
| Improve this Doc View SourceGet(IEnumerable<ItemPickupBase>)
Gets an System.Collections.Generic.IEnumerable<T> of Pickup containing all existing InventorySystem.Items.Pickups.ItemPickupBase instances given an System.Collections.Generic.IEnumerable<T> of InventorySystem.Items.Pickups.ItemPickupBase.
Declaration
public static IEnumerable<Pickup> Get(IEnumerable<ItemPickupBase> pickups)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.IEnumerable<InventorySystem.Items.Pickups.ItemPickupBase> | pickups | An System.Collections.Generic.IEnumerable<T> of InventorySystem.Items.Pickups.ItemPickupBase to convert into an System.Collections.Generic.IEnumerable<T> of Pickup. |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<Pickup> | An System.Collections.Generic.IEnumerable<T> of Pickup containing all existing InventorySystem.Items.Pickups.ItemPickupBase instances. |
Get(IEnumerable<GameObject>)
Gets an System.Collections.Generic.IEnumerable<T> of Pickup containing all existing InventorySystem.Items.Pickups.ItemPickupBase instances given an System.Collections.Generic.IEnumerable<T> of UnityEngine.GameObject.
Declaration
public static IEnumerable<Pickup> Get(IEnumerable<GameObject> gameObjects)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.IEnumerable<UnityEngine.GameObject> | gameObjects | The UnityEngine.GameObject's to check. |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<Pickup> | An System.Collections.Generic.IEnumerable<T> of Pickup containing all existing InventorySystem.Items.Pickups.ItemPickupBase instances. |
Get(UInt16)
Declaration
public static Pickup Get(ushort serial)
Parameters
| Type | Name | Description |
|---|---|---|
| System.UInt16 | serial | The serial to look for. |
Returns
| Type | Description |
|---|---|
| Pickup | The Pickup given the specified serial. |
Get(GameObject)
Gets the Pickup given a UnityEngine.GameObject.
Declaration
public static Pickup Get(GameObject gameObject)
Parameters
| Type | Name | Description |
|---|---|---|
| UnityEngine.GameObject | gameObject | The UnityEngine.GameObject to check. |
Returns
| Type | Description |
|---|---|
| Pickup | The Pickup given the specified UnityEngine.GameObject. |
Get<T>(ItemType)
Gets an System.Collections.Generic.IEnumerable<T> containing all existing InventorySystem.Items.Pickups.ItemPickupBase instances given an ItemType.
Declaration
public static IEnumerable<T> Get<T>(ItemType type)
where T : Pickup
Parameters
| Type | Name | Description |
|---|---|---|
| ItemType | type | The ItemType to look for. |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<T> | A System.Collections.Generic.IEnumerable<T> of Pickup. |
Type Parameters
| Name | Description |
|---|---|
| T | The type |
See Also
| Improve this Doc View SourceGet<T>(IEnumerable<ItemPickupBase>)
Gets an System.Collections.Generic.IEnumerable<T> of Pickup containing all existing InventorySystem.Items.Pickups.ItemPickupBase instances given a System.Collections.Generic.IEnumerable<T> of InventorySystem.Items.Pickups.ItemPickupBase.
Declaration
public static IEnumerable<T> Get<T>(IEnumerable<ItemPickupBase> pickups)
where T : Pickup
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.IEnumerable<InventorySystem.Items.Pickups.ItemPickupBase> | pickups | An System.Collections.Generic.IEnumerable<T> of InventorySystem.Items.Pickups.ItemPickupBase to convert into an System.Collections.Generic.IEnumerable<T> of Pickup. |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<T> | An System.Collections.Generic.IEnumerable<T> of Pickup containing all existing InventorySystem.Items.Pickups.ItemPickupBase instances. |
Type Parameters
| Name | Description |
|---|---|
| T | The type |
Get<T>(IEnumerable<GameObject>)
Gets an System.Collections.Generic.IEnumerable<T> containing all existing InventorySystem.Items.Pickups.ItemPickupBase instances given a System.Collections.Generic.IEnumerable<T> of UnityEngine.GameObject.
Declaration
public static IEnumerable<T> Get<T>(IEnumerable<GameObject> gameObjects)
where T : Pickup
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.IEnumerable<UnityEngine.GameObject> | gameObjects | The UnityEngine.GameObject's to check. |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<T> | The Pickup given the specified UnityEngine.GameObject. |
Type Parameters
| Name | Description |
|---|---|
| T | The type |
InitializeProperties(ItemBase)
initialize item properties.
Declaration
protected virtual void InitializeProperties(ItemBase itemBase)
Parameters
| Type | Name | Description |
|---|---|---|
| InventorySystem.Items.ItemBase | itemBase | target item. |
PickupTimeForPlayer(Player)
Returns the amount of time it will take for the provided player to pick up this item, based on Weight and active status effects.
Declaration
public float PickupTimeForPlayer(Player player)
Parameters
| Type | Name | Description |
|---|---|---|
| Player | player | The player to check search time. |
Returns
| Type | Description |
|---|---|
| System.Single | The amount of time it will take for the provided |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | player cannot be null. |
See Also
| Improve this Doc View SourceSpawn()
Spawns pickup on a server.
Declaration
public void Spawn()
See Also
| Improve this Doc View SourceSpawn(Pickup, Vector3, Quaternion, Player)
Spawns a Pickup.
Declaration
[Obsolete("Use pickup.Spawn(Vector3, Quaternion, Player) instead of this", true)]
public static Pickup Spawn(Pickup pickup, Vector3 position, Quaternion rotation, Player previousOwner = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Pickup | pickup | The Pickup too spawn. |
| UnityEngine.Vector3 | position | The position to spawn the Pickup at. |
| UnityEngine.Quaternion | rotation | The rotation to spawn the Pickup. |
| Player | previousOwner | An optional previous owner of the item. |
Returns
| Type | Description |
|---|---|
| Pickup | The Pickup Spawn. |
See Also
| Improve this Doc View SourceSpawn(Vector3, Quaternion, Player)
Spawns pickup on a server.
Declaration
public Pickup Spawn(Vector3 position, Quaternion rotation, Player previousOwner = null)
Parameters
| Type | Name | Description |
|---|---|---|
| UnityEngine.Vector3 | position | The position to spawn the Pickup at. |
| UnityEngine.Quaternion | rotation | The rotation to spawn the Pickup. |
| Player | previousOwner | An optional previous owner of the item. |
Returns
| Type | Description |
|---|---|
| Pickup | The spawned Pickup. |
See Also
| Improve this Doc View SourceToString()
Returns the Pickup in a human readable format.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| System.String | A string containing Pickup-related data. |
Overrides
UnSpawn()
Unspawns pickup on server.
Declaration
public void UnSpawn()