Class CustomKeycard
- Namespace
- Exiled.CustomItems.API.Features
- Assembly
- Exiled.CustomItems.dll
The Custom keycard base class.
public abstract class CustomKeycard : CustomItem
- Inheritance
-
CustomKeycard
- Inherited Members
- Extension Methods
Properties
KeycardLabel
Gets or sets a label for keycard.
public virtual string KeycardLabel { get; set; }
Property Value
KeycardLabelColor
Gets or sets a color of keycard label.
public virtual Color32? KeycardLabelColor { get; set; }
Property Value
- Color32?
KeycardName
Gets or sets name of keycard holder.
public virtual string KeycardName { get; set; }
Property Value
KeycardPermissionsColor
Gets or sets a color of keycard permissions.
public virtual Color32? KeycardPermissionsColor { get; set; }
Property Value
- Color32?
Permissions
Gets or sets the permissions for custom keycard.
public virtual KeycardPermissions Permissions { get; set; }
Property Value
Rank
Gets or sets the rank of a keycard.
public virtual byte Rank { get; set; }
Property Value
Remarks
Only works on CustomTaskForce keycards with values 0-3. Value runs in reverse (3 is rank 1, 2 -> 2, 1 -> 3, 0 -> 0).
SerialNumber
Gets or sets the serial number of a keycard.
public virtual string SerialNumber { get; set; }
Property Value
Remarks
Only works on CustomMetalCase and CustomTaskForce keycards. Max length is 12. Non-numerical characters will be replaced with '-'.
TintColor
Gets or sets a tint color.
public virtual Color32? TintColor { get; set; }
Property Value
- Color32?
Type
Gets or sets the ItemType to use for this item.
public override ItemType Type { get; set; }
Property Value
- ItemType
Exceptions
- ArgumentOutOfRangeException
Throws if specified ItemType is not Keycard.
Wear
Gets or sets the wear of a keycard.
public virtual byte Wear { get; set; }
Property Value
Remarks
Only works on CustomSite02 keycards with values 0-4 and CustomMetalCase keycards with values 0-5.
Methods
Give(Player, Item, bool)
Gives an Item as a CustomItem to a Player.
public override void Give(Player player, Item item, bool displayMessage = true)
Parameters
playerPlayerThe Player who will receive the item.
itemItemThe Item to be given.
displayMessageboolIndicates whether ShowPickedUpMessage(Player) will be called when the player receives the item.
OnInteractingDoor(Player, Door)
Called when custom keycard interacts with a door.
protected virtual void OnInteractingDoor(Player player, Door door)
Parameters
OnInteractingLocker(Player, Chamber)
Called when custom keycard interacts with a locker.
protected virtual void OnInteractingLocker(Player player, Chamber chamber)
Parameters
SetupKeycard(Keycard)
Setups keycard according to this class.
protected virtual void SetupKeycard(Keycard keycard)
Parameters
keycardKeycardItem instance.
Spawn(Vector3, Item, Player?)
Spawns the CustomItem in a specific position.
public override Pickup? Spawn(Vector3 position, Item item, Player? previousOwner = null)
Parameters
positionVector3The UnityEngine.Vector3 where the CustomItem will be spawned.
itemItemThe Item to be spawned as a CustomItem.
previousOwnerPlayerThe PreviousOwner of the item. Can be null.
Returns
- Pickup
The Pickup of the spawned CustomItem.
SubscribeEvents()
Called after the manager is initialized, to allow loading of special event handlers.
protected override void SubscribeEvents()
UnsubscribeEvents()
Called when the manager is being destroyed, to allow unloading of special event handlers.
protected override void UnsubscribeEvents()