Bullet Magazines
The BulletMagazine is a clip-based magazine with support for manual and automatic reload. It extends the abstract Magazine base and is commonly used for ballistic weapons like rifles and pistols.
Summary
This component:
- Uses a clip-based ammo system
 - Supports timed reload with events
 - Optionally resumes shooting if interrupted
 - Handles player reload input
 
Fields
| Field | Type | Description | 
|---|---|---|
_autoReload | bool | If true, the magazine reloads automatically when empty. | 
reloadTime | float | Duration of the reload in seconds. | 
reloadable | bool | If false, disables manual reloading. | 
_controls | WeaponControls | Input bindings for reload input. (Runtime only) | 
_waitRoutine | Coroutine | Coroutine handler for timed reloads. (Runtime only) | 
Inherited Fields
See Magazine for:
clip,clipSizeOnDepleted,OnStartReload,OnReloadComplete
Public Methods
| Method | Description | 
|---|---|
override void Reload() | Starts the reload process, invoking events and managing timing. | 
override bool IsDepleted() | Checks if the clip is empty and optionally auto-reloads. | 
Private Methods
| Method | Description | 
|---|---|
CompleteReload(bool wasShooting) | Resets clip, optionally resumes shooting, and fires events. | 
Input Behavior
- Listens to the 
Reloadinput from theWeaponControlsinput map. - Only active if 
reloadable == true. 
Reload Flow
- Player presses reload key (or auto-reload is triggered).
 - Events:
OnStartReloadis called immediately.- After 
reloadTime, clip is refilled. OnReloadCompleteis called.
 - If the weapon was shooting when reload started, it resumes firing automatically.
 
Tip
You can bind SFX, VFX, or animations to OnStartReload and OnReloadComplete.
Warning
Don’t forget to disable reloading logic for energy-based weapons that use charging instead.