Class Laser
Renders a laser beam that can interact with the terrain.
Namespace: WeaverCore.Components
Assembly: WeaverCore.dll
Syntax
[ExecuteAlways]
[RequireComponent(typeof(MeshFilter), typeof(MeshRenderer))]
public class Laser : MonoBehaviour
Properties
| Edit this page View SourceBottomColliderEdge
Returns the collider coordinates for the bottom edge of the laser beam.
Declaration
public (Vector2 start, Vector2 end) BottomColliderEdge { get; }
Property Value
Type | Description |
---|---|
(Vector2 start, Vector2 end) |
CollideWithTerrain
Determines if the laser should collide with terrain.
Declaration
public bool CollideWithTerrain { get; set; }
Property Value
Type | Description |
---|---|
bool |
ColliderContactNormals
Returns the collider contact normals of the laser beam.
Declaration
public List<Vector2> ColliderContactNormals { get; }
Property Value
Type | Description |
---|---|
List<Vector2> |
ColliderContactPoints
Returns the collider contact points of the laser beam.
Declaration
public List<Vector2> ColliderContactPoints { get; }
Property Value
Type | Description |
---|---|
List<Vector2> |
ColliderQuality
The quality of the laser beam collider.
Declaration
public int ColliderQuality { get; set; }
Property Value
Type | Description |
---|---|
int |
CollisionMask
The collision mask the laser will use for collision.
Declaration
public LayerMask CollisionMask { get; set; }
Property Value
Type | Description |
---|---|
LayerMask |
Color
Gets or sets the color of the laser beam.
Declaration
public Color Color { get; set; }
Property Value
Type | Description |
---|---|
Color |
LengthSubdivisions
The number of subdivisions for the length of the laser beam.
Declaration
public uint LengthSubdivisions { get; set; }
Property Value
Type | Description |
---|---|
uint |
MainCollider
Returns the main collider of the laser beam.
Declaration
public PolygonCollider2D MainCollider { get; }
Property Value
Type | Description |
---|---|
PolygonCollider2D |
MainRenderer
Returns the main renderer of the laser beam.
Declaration
public MeshRenderer MainRenderer { get; }
Property Value
Type | Description |
---|---|
MeshRenderer |
MaximumLength
The maximum length of the laser beam.
Declaration
public float MaximumLength { get; set; }
Property Value
Type | Description |
---|---|
float |
Quality
The quality of the laser beam.
Declaration
public int Quality { get; set; }
Property Value
Type | Description |
---|---|
int |
Spread
The angle in degrees the laser should spread out.
Declaration
public float Spread { get; set; }
Property Value
Type | Description |
---|---|
float |
Sprite
Gets or sets the sprite of the laser beam.
Declaration
public Sprite Sprite { get; set; }
Property Value
Type | Description |
---|---|
Sprite |
SpriteOffset
Gets the sprite offset of the laser beam.
Declaration
public Vector2 SpriteOffset { get; }
Property Value
Type | Description |
---|---|
Vector2 |
SpriteScale
Gets the sprite scale of the laser beam.
Declaration
public Vector2 SpriteScale { get; }
Property Value
Type | Description |
---|---|
Vector2 |
StartingWidth
How wide the laser should be at the start.
Declaration
public float StartingWidth { get; set; }
Property Value
Type | Description |
---|---|
float |
TextureBottomEdge
Returns the texture coordinates for the bottom edge of the laser beam.
Declaration
public (Vector2 start, Vector2 end) TextureBottomEdge { get; }
Property Value
Type | Description |
---|---|
(Vector2 start, Vector2 end) |
TextureContactPoints
Returns the texture contact points of the laser beam.
Declaration
public List<Vector2> TextureContactPoints { get; }
Property Value
Type | Description |
---|---|
List<Vector2> |
TextureStretch
The stretch factor for the laser beam texture.
Declaration
public float TextureStretch { get; set; }
Property Value
Type | Description |
---|---|
float |
TextureTopEdge
Returns the texture coordinates for the top edge of the laser beam.
Declaration
public (Vector2 start, Vector2 end) TextureTopEdge { get; }
Property Value
Type | Description |
---|---|
(Vector2 start, Vector2 end) |
TopColliderEdge
Returns the collider coordinates for the top edge of the laser beam.
Declaration
public (Vector2 start, Vector2 end) TopColliderEdge { get; }
Property Value
Type | Description |
---|---|
(Vector2 start, Vector2 end) |