Add this class to a weapon and it'll prevent shooting when close to an obstacle (as defined by the ObstacleLayerMask)
More...
|
float | Angle = 5f |
| the angle to consider when deciding whether or not there's a wall in front of the weapon (usually 5 degrees is fine) More...
|
|
float | Distance = 2f |
| the max distance to the wall we want to prevent shooting from More...
|
|
Vector3 | RaycastOriginOffset = Vector3.zero |
| the offset to apply to the detection (in addition and relative to the weapon's position) More...
|
|
LayerMask | ObstacleLayerMask = LayerManager.ObstaclesLayerMask |
| the layers to consider as obstacles More...
|
|
|
virtual void | Awake () |
| On Awake we grab our weapon More...
|
|
virtual bool | CheckForObstacles () |
| Casts rays in front of the weapon to check for obstacles Returns true if an obstacle was found More...
|
|
Add this class to a weapon and it'll prevent shooting when close to an obstacle (as defined by the ObstacleLayerMask)
◆ Awake()
virtual void MoreMountains.TopDownEngine.WeaponPreventShootingWhenCloseToWalls2D.Awake |
( |
| ) |
|
|
protectedvirtual |
On Awake we grab our weapon
◆ CheckForObstacles()
virtual bool MoreMountains.TopDownEngine.WeaponPreventShootingWhenCloseToWalls2D.CheckForObstacles |
( |
| ) |
|
|
protectedvirtual |
Casts rays in front of the weapon to check for obstacles Returns true if an obstacle was found
- Returns
◆ ShootingAllowed()
override bool MoreMountains.TopDownEngine.WeaponPreventShootingWhenCloseToWalls2D.ShootingAllowed |
( |
| ) |
|
|
virtual |
◆ _hitLeft
RaycastHit2D MoreMountains.TopDownEngine.WeaponPreventShootingWhenCloseToWalls2D._hitLeft |
|
protected |
◆ _hitMiddle
RaycastHit2D MoreMountains.TopDownEngine.WeaponPreventShootingWhenCloseToWalls2D._hitMiddle |
|
protected |
◆ _hitRight
RaycastHit2D MoreMountains.TopDownEngine.WeaponPreventShootingWhenCloseToWalls2D._hitRight |
|
protected |
◆ _weaponAim
WeaponAim MoreMountains.TopDownEngine.WeaponPreventShootingWhenCloseToWalls2D._weaponAim |
|
protected |
◆ Angle
float MoreMountains.TopDownEngine.WeaponPreventShootingWhenCloseToWalls2D.Angle = 5f |
the angle to consider when deciding whether or not there's a wall in front of the weapon (usually 5 degrees is fine)
◆ Distance
float MoreMountains.TopDownEngine.WeaponPreventShootingWhenCloseToWalls2D.Distance = 2f |
the max distance to the wall we want to prevent shooting from
◆ ObstacleLayerMask
LayerMask MoreMountains.TopDownEngine.WeaponPreventShootingWhenCloseToWalls2D.ObstacleLayerMask = LayerManager.ObstaclesLayerMask |
the layers to consider as obstacles
◆ RaycastOriginOffset
Vector3 MoreMountains.TopDownEngine.WeaponPreventShootingWhenCloseToWalls2D.RaycastOriginOffset = Vector3.zero |
the offset to apply to the detection (in addition and relative to the weapon's position)
The documentation for this class was generated from the following file: