Corgi Engine  v8.8
MoreMountains.CorgiEngine.WeaponLaserSight Class Reference

Add this class to a weapon and it'll project a laser ray towards the direction the weapon is facing More...

Inheritance diagram for MoreMountains.CorgiEngine.WeaponLaserSight:
MoreMountains.CorgiEngine.CorgiMonoBehaviour

Public Member Functions

virtual void LaserActive (bool status)
 Turns the laser on or off depending on the status passed in parameters More...
 

Public Attributes

Vector3 RaycastOriginOffset
 the origin of the raycast used to detect obstacles More...
 
Vector3 LaserOriginOffset
 the origin of the visible laser More...
 
float LaserMaxDistance = 50
 the maximum distance to which we should draw the laser More...
 
LayerMask LaserCollisionMask = LayerManager.ObstaclesLayerMask
 the collision mask containing all layers that should stop the laser More...
 
Vector2 LaserWidth = new Vector2(0.05f, 0.05f)
 the width of the laser More...
 
Material LaserMaterial
 the material used to render the laser More...
 
Vector3 LaserOrigin => _origin
 the world space coordinates of the laser's origin point More...
 
Vector3 LaserDestination => _destination
 the world space coordinates of the laser's destination point More...
 

Protected Member Functions

virtual void Start ()
 Initialization More...
 
virtual void Initialization ()
 Initialization More...
 
virtual void Update ()
 Every frame we draw our laser More...
 
virtual void ShootLaser ()
 Draws the actual laser More...
 

Protected Attributes

Weapon _weapon
 
Vector3 _direction
 
LineRenderer _line
 
RaycastHit2D _hit
 
Vector3 _origin
 
Vector3 _destination
 
Vector3 _laserOffset
 
Vector3 _weaponPosition
 
Quaternion _weaponRotation
 

Detailed Description

Add this class to a weapon and it'll project a laser ray towards the direction the weapon is facing

Member Function Documentation

◆ Initialization()

virtual void MoreMountains.CorgiEngine.WeaponLaserSight.Initialization ( )
protectedvirtual

Initialization

◆ LaserActive()

virtual void MoreMountains.CorgiEngine.WeaponLaserSight.LaserActive ( bool  status)
virtual

Turns the laser on or off depending on the status passed in parameters

Parameters
statusIf set to true status.

◆ ShootLaser()

virtual void MoreMountains.CorgiEngine.WeaponLaserSight.ShootLaser ( )
protectedvirtual

Draws the actual laser

◆ Start()

virtual void MoreMountains.CorgiEngine.WeaponLaserSight.Start ( )
protectedvirtual

Initialization

◆ Update()

virtual void MoreMountains.CorgiEngine.WeaponLaserSight.Update ( )
protectedvirtual

Every frame we draw our laser

Member Data Documentation

◆ _destination

Vector3 MoreMountains.CorgiEngine.WeaponLaserSight._destination
protected

◆ _direction

Vector3 MoreMountains.CorgiEngine.WeaponLaserSight._direction
protected

◆ _hit

RaycastHit2D MoreMountains.CorgiEngine.WeaponLaserSight._hit
protected

◆ _laserOffset

Vector3 MoreMountains.CorgiEngine.WeaponLaserSight._laserOffset
protected

◆ _line

LineRenderer MoreMountains.CorgiEngine.WeaponLaserSight._line
protected

◆ _origin

Vector3 MoreMountains.CorgiEngine.WeaponLaserSight._origin
protected

◆ _weapon

Weapon MoreMountains.CorgiEngine.WeaponLaserSight._weapon
protected

◆ _weaponPosition

Vector3 MoreMountains.CorgiEngine.WeaponLaserSight._weaponPosition
protected

◆ _weaponRotation

Quaternion MoreMountains.CorgiEngine.WeaponLaserSight._weaponRotation
protected

◆ LaserCollisionMask

LayerMask MoreMountains.CorgiEngine.WeaponLaserSight.LaserCollisionMask = LayerManager.ObstaclesLayerMask

the collision mask containing all layers that should stop the laser

◆ LaserDestination

Vector3 MoreMountains.CorgiEngine.WeaponLaserSight.LaserDestination => _destination

the world space coordinates of the laser's destination point

◆ LaserMaterial

Material MoreMountains.CorgiEngine.WeaponLaserSight.LaserMaterial

the material used to render the laser

◆ LaserMaxDistance

float MoreMountains.CorgiEngine.WeaponLaserSight.LaserMaxDistance = 50

the maximum distance to which we should draw the laser

◆ LaserOrigin

Vector3 MoreMountains.CorgiEngine.WeaponLaserSight.LaserOrigin => _origin

the world space coordinates of the laser's origin point

◆ LaserOriginOffset

Vector3 MoreMountains.CorgiEngine.WeaponLaserSight.LaserOriginOffset

the origin of the visible laser

◆ LaserWidth

Vector2 MoreMountains.CorgiEngine.WeaponLaserSight.LaserWidth = new Vector2(0.05f, 0.05f)

the width of the laser

◆ RaycastOriginOffset

Vector3 MoreMountains.CorgiEngine.WeaponLaserSight.RaycastOriginOffset

the origin of the raycast used to detect obstacles


The documentation for this class was generated from the following file: