Class EntityHoldWeapon
- Namespace
- VoxelPlayground.Entity
- Assembly
- GamePlay.dll
Represents a weapon that fires continuously while the trigger is held down.
public class EntityHoldWeapon : EntityFirableWeapon
- Inheritance
-
objectEntityHoldWeapon
- Derived
- Inherited Members
- Extension Methods
Fields
interval
Time interval in seconds between each shot.
[InfoBox("Interval is the time it takes between each shot.", InfoMessageType.Info, null)]
public float interval
Field Value
- float
shotBlockSound
The type of sound to play if firing is blocked.
[InfoBox("ShotBlockSound is the sound type in between each shot if triggered.", InfoMessageType.Info, null)]
public ShotBlockSoundType shotBlockSound
Field Value
Methods
FireOnce()
Fires a single shot.
public virtual void FireOnce()
FireReloadPercentage()
Gets the percentage of readiness to fire (0.0 to 1.0).
public override float FireReloadPercentage()
Returns
- float
The readiness percentage.
OnReloadComplete()
Called when reloading is complete. Resets fire timer.
protected override void OnReloadComplete()
OnTriggerPressed()
Called when the trigger is pressed. Initiates firing sequence.
public override void OnTriggerPressed()
OnTriggerReleased()
Called when the trigger is released. Stops firing.
public override void OnTriggerReleased()
Update()
Updates the weapon state, handling firing interval and reloading.
public virtual void Update()