Corgi Engine
v9.0
|
Add this class to a weapon and it'll project a laser ray towards the direction the weapon is facing More...
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 |
Add this class to a weapon and it'll project a laser ray towards the direction the weapon is facing
|
protectedvirtual |
Initialization
|
virtual |
Turns the laser on or off depending on the status passed in parameters
status | If set to true status. |
|
protectedvirtual |
Draws the actual laser
|
protectedvirtual |
Initialization
|
protectedvirtual |
Every frame we draw our laser
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
LayerMask MoreMountains.CorgiEngine.WeaponLaserSight.LaserCollisionMask = LayerManager.ObstaclesLayerMask |
the collision mask containing all layers that should stop the laser
Vector3 MoreMountains.CorgiEngine.WeaponLaserSight.LaserDestination => _destination |
the world space coordinates of the laser's destination point
Material MoreMountains.CorgiEngine.WeaponLaserSight.LaserMaterial |
the material used to render the laser
float MoreMountains.CorgiEngine.WeaponLaserSight.LaserMaxDistance = 50 |
the maximum distance to which we should draw the laser
Vector3 MoreMountains.CorgiEngine.WeaponLaserSight.LaserOrigin => _origin |
the world space coordinates of the laser's origin point
Vector3 MoreMountains.CorgiEngine.WeaponLaserSight.LaserOriginOffset |
the origin of the visible laser
Vector2 MoreMountains.CorgiEngine.WeaponLaserSight.LaserWidth = new Vector2(0.05f, 0.05f) |
the width of the laser
Vector3 MoreMountains.CorgiEngine.WeaponLaserSight.RaycastOriginOffset |
the origin of the raycast used to detect obstacles