Class Projectile
A wrapper class for Projectile.
Implements
Inherited Members
Namespace: Exiled.API.Features.Pickups.Projectiles
Assembly: Exiled.API.dll
Syntax
public class Projectile : Pickup, IWrapper<ItemPickupBase>, IWorldSpace, IPosition, IRotation, IWrapper<ThrownProjectile>
Properties
| Improve this Doc View SourceBase
Gets the InventorySystem.Items.ThrowableProjectiles.ThrownProjectile that this class is encapsulating.
Declaration
public ThrownProjectile Base { get; }
Property Value
| Type | Description |
|---|---|
| InventorySystem.Items.ThrowableProjectiles.ThrownProjectile |
ProjectileType
Gets the ProjectileType of the item.
Declaration
public ProjectileType ProjectileType { get; }
Property Value
| Type | Description |
|---|---|
| ProjectileType |
Methods
| Improve this Doc View SourceActivate()
Activates the current Projectile.
Declaration
public void Activate()
Create(ProjectileType)
Creates and returns a new Projectile with the proper inherited subclass.
Based on the projectiletype, the returned Projectile can be casted into a subclass to gain more control over the object.
The following have their own respective classes:
- FragGrenade can be casted to ExplosionGrenadeProjectile.
- Flashbang can be casted to FlashbangProjectile.
- Scp018 A and B variants can be casted to Scp018Projectile.
- Scp2176 can be casted to Scp2176Projectile.
Projectile that are not listed will cause an Exception.
Declaration
public static Projectile Create(ProjectileType projectiletype)
Parameters
| Type | Name | Description |
|---|---|---|
| ProjectileType | projectiletype | The ProjectileType of the pickup. |
Returns
| Type | Description |
|---|---|
| Projectile | The created Pickup. |
CreateAndSpawn(ProjectileType, Vector3, Quaternion, Boolean, Player)
Creates and spawns a Projectile.
Declaration
public static Projectile CreateAndSpawn(ProjectileType type, Vector3 position, Quaternion rotation, bool shouldBeActive = true, Player previousOwner = null)
Parameters
| Type | Name | Description |
|---|---|---|
| ProjectileType | type | The ItemType of the pickup. |
| UnityEngine.Vector3 | position | The position to spawn the Projectile at. |
| UnityEngine.Quaternion | rotation | The rotation to spawn the Projectile. |
| System.Boolean | shouldBeActive | Whether the Projectile should be in active state after spawn. |
| Player | previousOwner | An optional previous owner of the item. |
Returns
| Type | Description |
|---|---|
| Projectile | The Projectile. See documentation of Create(ItemType) for more information on casting. |
Spawn(Projectile, Vector3, Quaternion, Boolean, Player)
Spawns a Projectile.
Declaration
[Obsolete("Use pickup.Spawn(Vector3, Quaternion, Player) instead of this", true)]
public static Projectile Spawn(Projectile pickup, Vector3 position, Quaternion rotation, bool shouldBeActive = true, Player previousOwner = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Projectile | pickup | The Projectile too spawn. |
| UnityEngine.Vector3 | position | The position to spawn the Projectile at. |
| UnityEngine.Quaternion | rotation | The rotation to spawn the Projectile. |
| System.Boolean | shouldBeActive | Whether the Projectile should be in active state after spawn. |
| Player | previousOwner | An optional previous owner of the item. |
Returns
| Type | Description |
|---|---|
| Projectile | The Projectile Spawn. |
Spawn(Vector3, Quaternion, Boolean, Player)
Spawns a Projectile.
Declaration
public Projectile Spawn(Vector3 position, Quaternion rotation, bool shouldBeActive = true, Player previousOwner = null)
Parameters
| Type | Name | Description |
|---|---|---|
| UnityEngine.Vector3 | position | The position to spawn the Projectile at. |
| UnityEngine.Quaternion | rotation | The rotation to spawn the Projectile. |
| System.Boolean | shouldBeActive | Whether the Projectile should be in active state after spawn. |
| Player | previousOwner | An optional previous owner of the item. |
Returns
| Type | Description |
|---|---|
| Projectile | The spawned Projectile. |
ToString()
Returns the ProjectilePickup in a human readable format.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| System.String | A string containing ProjectilePickup-related data. |