AttachableMagWell
Updated a year agoAttachableMagWell
This documentation provides an explanation of the code for the AttachableMagWell
class.
Class Structure
The AttachableMagWell
class is a subclass of FVRFireArmReloadTriggerWell
within the AndrewFTW
namespace.
Public Fields
The class has the following public fields:
Attachment
(FVRFireArmAttachment): The firearm attachment associated with the mag well.MagGrabTrigger
(UniversalMagazineGrabTrigger): The magazine grab trigger for the mag well.MagMountPos
(Transform): The position where the magazine is mounted.MagEjectPos
(Transform): The position where the magazine is ejected.EjectDelay
(float): The delay before ejecting the magazine.
Private Fields
The class has the following private fields:
_attachMagwelllDict
(Dictionary<FVRFireArm, List<AttachableMagWell>>): A dictionary that maps a firearm to a list of attachable mag wells._index
(int): The index of the mag well within the firearm's secondary magazine slots._mySlot
(FVRFireArm.SecondaryMagazineSlot): The secondary magazine slot associated with the mag well.
Public Methods
The class has the following public methods:
OnEnable()
: Called when the component is enabled. It initializes the mag well by adding it to the list of secondary magazines of the firearm and setting up the magazine grab trigger.OnDisable()
: Called when the component is disabled. It removes the mag well from the list of secondary magazines of the firearm and cleans up references to the firearm and mag grab trigger.