Search Results for

    Show / Hide Table of Contents

    Class Pickup

    A wrapper class for InventorySystem.Items.Pickups.ItemPickupBase.

    Inheritance
    System.Object
    TypeCastObject<Pickup>
    Pickup
    AmmoPickup
    BodyArmorPickup
    FirearmPickup
    GrenadePickup
    JailbirdPickup
    KeycardPickup
    MicroHIDPickup
    Projectile
    RadioPickup
    Scp1576Pickup
    UsablePickup
    Implements
    IWrapper<InventorySystem.Items.Pickups.ItemPickupBase>
    IWorldSpace
    IPosition
    IRotation
    Inherited Members
    TypeCastObject<Pickup>.Cast<TObject>()
    TypeCastObject<Pickup>.Cast<TObject>(TObject)
    TypeCastObject<Pickup>.As<TObject>()
    TypeCastObject<Pickup>.Is<TObject>(TObject)
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    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 Source

    Base

    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
    | Improve this Doc View Source

    GameObject

    Gets the UnityEngine.GameObject of the Pickup.

    Declaration
    public GameObject GameObject { get; }
    Property Value
    Type Description
    UnityEngine.GameObject
    | Improve this Doc View Source

    Info

    Gets or sets the pickup information.

    Declaration
    public PickupSyncInfo Info { get; set; }
    Property Value
    Type Description
    InventorySystem.Items.Pickups.PickupSyncInfo
    | Improve this Doc View Source

    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
    | Improve this Doc View Source

    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
    | Improve this Doc View Source

    IsSpawned

    Gets a value indicating whether this pickup is spawned.

    Declaration
    public bool IsSpawned { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    List

    Gets a System.Collections.Generic.IEnumerable<T> of Pickup which contains all the Pickup instances.

    Declaration
    public static IEnumerable<Pickup> List { get; }
    Property Value
    Type Description
    System.Collections.Generic.IEnumerable<Pickup>
    | Improve this Doc View Source

    PhysicsModule

    Gets or sets the pickup's PhysicsModule.

    Declaration
    public PickupStandardPhysics PhysicsModule { get; set; }
    Property Value
    Type Description
    InventorySystem.Items.Pickups.PickupStandardPhysics
    | Improve this Doc View Source

    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
    Weight
    PickupTimeForPlayer(Player)
    | Improve this Doc View Source

    Position

    Gets or sets the pickup position.

    Declaration
    public Vector3 Position { get; set; }
    Property Value
    Type Description
    UnityEngine.Vector3
    See Also
    CreateAndSpawn(ItemType, Vector3, Quaternion, Player)
    | Improve this Doc View Source

    PreviousOwner

    Gets or sets the previous owner of this item.

    Declaration
    public Player PreviousOwner { get; set; }
    Property Value
    Type Description
    Player
    See Also
    CreateAndSpawn(ItemType, Vector3, Quaternion, Player)
    | Improve this Doc View Source

    RelativePosition

    Gets or sets the relative position of the pickup.

    Declaration
    public RelativePosition RelativePosition { get; set; }
    Property Value
    Type Description
    RelativePositioning.RelativePosition
    | Improve this Doc View Source

    Rigidbody

    Gets the UnityEngine.Rigidbody of the Pickup.

    Declaration
    public Rigidbody Rigidbody { get; }
    Property Value
    Type Description
    UnityEngine.Rigidbody
    | Improve this Doc View Source

    Room

    Gets the current Room the Pickup is in.

    Declaration
    public Room Room { get; }
    Property Value
    Type Description
    Room
    | Improve this Doc View Source

    Rotation

    Gets or sets the pickup rotation.

    Declaration
    public Quaternion Rotation { get; set; }
    Property Value
    Type Description
    UnityEngine.Quaternion
    See Also
    CreateAndSpawn(ItemType, Vector3, Quaternion, Player)
    | Improve this Doc View Source

    Scale

    Gets or sets the pickup's scale value.

    Declaration
    public Vector3 Scale { get; set; }
    Property Value
    Type Description
    UnityEngine.Vector3
    | Improve this Doc View Source

    Serial

    Gets or sets the unique serial number for the item.

    Declaration
    public ushort Serial { get; set; }
    Property Value
    Type Description
    System.UInt16
    | Improve this Doc View Source

    Transform

    Gets the UnityEngine.Transform of the Pickup.

    Declaration
    public Transform Transform { get; }
    Property Value
    Type Description
    UnityEngine.Transform
    | Improve this Doc View Source

    Type

    Gets the ItemType of the item.

    Declaration
    public ItemType Type { get; }
    Property Value
    Type Description
    ItemType
    | Improve this Doc View Source

    Weight

    Gets or sets the weight of the item.

    Declaration
    public float Weight { get; set; }
    Property Value
    Type Description
    System.Single
    See Also
    PickupTime

    Methods

    | Improve this Doc View Source

    Clone()

    Clones the current pickup with a different serial.

    Declaration
    public virtual Pickup Clone()
    Returns
    Type Description
    Pickup

    Cloned pickup object.

    | Improve this Doc View Source

    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
    Create(ProjectileType)
    | Improve this Doc View Source

    CreateAndSpawn(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
    CreateAndSpawn(ProjectileType, UnityEngine.Vector3, UnityEngine.Quaternion, System.Boolean, Player)
    | Improve this Doc View Source

    Destroy()

    Destroys the already spawned pickup.

    Declaration
    public void Destroy()
    See Also
    UnSpawn()
    | Improve this Doc View Source

    Get(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.

    | Improve this Doc View Source

    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
    GetRandomPickup(ItemType)
    | Improve this Doc View Source

    Get(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.

    | Improve this Doc View Source

    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.

    | Improve this Doc View Source

    Get(UInt16)

    Gets the Pickup given a Serial.

    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.

    | Improve this Doc View Source

    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.

    | Improve this Doc View Source

    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 T to cast the pickups to.

    See Also
    GetRandomPickup(ItemType)
    | Improve this Doc View Source

    Get<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 T to cast the pickups to.

    | Improve this Doc View Source

    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 T to cast the pickups to.

    | Improve this Doc View Source

    InitializeProperties(ItemBase)

    initialize item properties.

    Declaration
    protected virtual void InitializeProperties(ItemBase itemBase)
    Parameters
    Type Name Description
    InventorySystem.Items.ItemBase itemBase

    target item.

    | Improve this Doc View Source

    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 player to pick up this item.

    Exceptions
    Type Condition
    System.ArgumentNullException

    player cannot be null.

    See Also
    PickupTime
    | Improve this Doc View Source

    Spawn()

    Spawns pickup on a server.

    Declaration
    public void Spawn()
    See Also
    UnSpawn()
    | Improve this Doc View Source

    Spawn(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
    Spawn(UnityEngine.Vector3, UnityEngine.Quaternion, System.Boolean, Player)
    | Improve this Doc View Source

    Spawn(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
    Spawn(UnityEngine.Vector3, UnityEngine.Quaternion, System.Boolean, Player)
    | Improve this Doc View Source

    ToString()

    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
    System.Object.ToString()
    | Improve this Doc View Source

    UnSpawn()

    Unspawns pickup on server.

    Declaration
    public void UnSpawn()
    See Also
    Spawn()
    Destroy()

    Implements

    IWrapper<T>
    IWorldSpace
    IPosition
    IRotation

    Extension Methods

    ReflectionExtensions.CopyProperties(Object, Object)
    • Improve this Doc
    • View Source
    In This Article
    Back to top Generated by DocFX