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 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)
◆ CheckForObstacles()
virtual bool MoreMountains.TopDownEngine.WeaponPreventShootingWhenCloseToWalls3D.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.WeaponPreventShootingWhenCloseToWalls3D.ShootingAllowed |
( |
| ) |
|
|
virtual |
◆ _hitLeft
RaycastHit MoreMountains.TopDownEngine.WeaponPreventShootingWhenCloseToWalls3D._hitLeft |
|
protected |
◆ _hitMiddle
RaycastHit MoreMountains.TopDownEngine.WeaponPreventShootingWhenCloseToWalls3D._hitMiddle |
|
protected |
◆ _hitRight
RaycastHit MoreMountains.TopDownEngine.WeaponPreventShootingWhenCloseToWalls3D._hitRight |
|
protected |
◆ Angle
float MoreMountains.TopDownEngine.WeaponPreventShootingWhenCloseToWalls3D.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.WeaponPreventShootingWhenCloseToWalls3D.Distance = 2f |
the max distance to the wall we want to prevent shooting from
◆ ObstacleLayerMask
LayerMask MoreMountains.TopDownEngine.WeaponPreventShootingWhenCloseToWalls3D.ObstacleLayerMask = LayerManager.ObstaclesLayerMask |
the layers to consider as obstacles
◆ RaycastOriginOffset
Vector3 MoreMountains.TopDownEngine.WeaponPreventShootingWhenCloseToWalls3D.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: