Adds this component on a weapon with a WeaponAutoAim (2D or 3D) and it will automatically shoot at targets after an optional delay To prevent/stop auto shoot, simply disable this component, and enable it again to resume auto shoot.
More...
|
| virtual void | Start () |
| | On Awake we initialize our component.
|
| virtual void | Initialization () |
| | Grabs auto aim and weapon.
|
| virtual void | LateUpdate () |
| | On Update we handle auto shoot.
|
| virtual void | HandleAutoShoot () |
| | Checks if we have a target for enough time, and shoots if needed.
|
Adds this component on a weapon with a WeaponAutoAim (2D or 3D) and it will automatically shoot at targets after an optional delay To prevent/stop auto shoot, simply disable this component, and enable it again to resume auto shoot.
◆ CanAutoShoot()
| virtual bool MoreMountains.TopDownEngine.WeaponAutoShoot.CanAutoShoot |
( |
| ) |
|
|
virtual |
Returns true if this weapon can autoshoot, false otherwise.
- Returns
◆ HandleAutoShoot()
| virtual void MoreMountains.TopDownEngine.WeaponAutoShoot.HandleAutoShoot |
( |
| ) |
|
|
protectedvirtual |
Checks if we have a target for enough time, and shoots if needed.
◆ Initialization()
| virtual void MoreMountains.TopDownEngine.WeaponAutoShoot.Initialization |
( |
| ) |
|
|
protectedvirtual |
Grabs auto aim and weapon.
◆ LateUpdate()
| virtual void MoreMountains.TopDownEngine.WeaponAutoShoot.LateUpdate |
( |
| ) |
|
|
protectedvirtual |
On Update we handle auto shoot.
◆ SetCurrentWeapon()
| virtual void MoreMountains.TopDownEngine.WeaponAutoShoot.SetCurrentWeapon |
( |
Weapon | newWeapon | ) |
|
|
virtual |
A public method you can use to update the cached Weapon.
- Parameters
-
◆ Start()
| virtual void MoreMountains.TopDownEngine.WeaponAutoShoot.Start |
( |
| ) |
|
|
protectedvirtual |
On Awake we initialize our component.
◆ _hasWeaponAndAutoAim
| bool MoreMountains.TopDownEngine.WeaponAutoShoot._hasWeaponAndAutoAim |
|
protected |
◆ _lastTarget
| Transform MoreMountains.TopDownEngine.WeaponAutoShoot._lastTarget |
|
protected |
◆ _targetAcquiredAt
| float MoreMountains.TopDownEngine.WeaponAutoShoot._targetAcquiredAt |
|
protected |
◆ _weapon
| Weapon MoreMountains.TopDownEngine.WeaponAutoShoot._weapon |
|
protected |
◆ _weaponAutoAim
| WeaponAutoAim MoreMountains.TopDownEngine.WeaponAutoShoot._weaponAutoAim |
|
protected |
◆ DelayBeforeShootAfterAcquiringTarget
| float MoreMountains.TopDownEngine.WeaponAutoShoot.DelayBeforeShootAfterAcquiringTarget = 0.1f |
the delay (in seconds) between acquiring a target and starting shooting at it
◆ OnlyAutoShootIfOwnerIsIdle
| bool MoreMountains.TopDownEngine.WeaponAutoShoot.OnlyAutoShootIfOwnerIsIdle = false |
if this is true, the weapon will only auto shoot if its owner is idle
The documentation for this class was generated from the following file:
- H:/Code/MoreMountains/topdownengine/Assets/TopDownEngine/Common/Scripts/Characters/Weapons/WeaponAutoShoot.cs