Show / Hide Table of Contents

Class Laser

Renders a laser beam that can interact with the terrain.

Inheritance
object
Object
Component
Behaviour
MonoBehaviour
Laser
Namespace: WeaverCore.Components
Assembly: WeaverCore.dll
Syntax
[ExecuteAlways]
[RequireComponent(typeof(MeshFilter), typeof(MeshRenderer))]
public class Laser : MonoBehaviour

Properties

| Edit this page View Source

BottomColliderEdge

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)
| Edit this page View Source

CollideWithTerrain

Determines if the laser should collide with terrain.

Declaration
public bool CollideWithTerrain { get; set; }
Property Value
Type Description
bool
| Edit this page View Source

ColliderContactNormals

Returns the collider contact normals of the laser beam.

Declaration
public List<Vector2> ColliderContactNormals { get; }
Property Value
Type Description
List<Vector2>
| Edit this page View Source

ColliderContactPoints

Returns the collider contact points of the laser beam.

Declaration
public List<Vector2> ColliderContactPoints { get; }
Property Value
Type Description
List<Vector2>
| Edit this page View Source

ColliderQuality

The quality of the laser beam collider.

Declaration
public int ColliderQuality { get; set; }
Property Value
Type Description
int
| Edit this page View Source

CollisionMask

The collision mask the laser will use for collision.

Declaration
public LayerMask CollisionMask { get; set; }
Property Value
Type Description
LayerMask
| Edit this page View Source

Color

Gets or sets the color of the laser beam.

Declaration
public Color Color { get; set; }
Property Value
Type Description
Color
| Edit this page View Source

LengthSubdivisions

The number of subdivisions for the length of the laser beam.

Declaration
public uint LengthSubdivisions { get; set; }
Property Value
Type Description
uint
| Edit this page View Source

MainCollider

Returns the main collider of the laser beam.

Declaration
public PolygonCollider2D MainCollider { get; }
Property Value
Type Description
PolygonCollider2D
| Edit this page View Source

MainRenderer

Returns the main renderer of the laser beam.

Declaration
public MeshRenderer MainRenderer { get; }
Property Value
Type Description
MeshRenderer
| Edit this page View Source

MaximumLength

The maximum length of the laser beam.

Declaration
public float MaximumLength { get; set; }
Property Value
Type Description
float
| Edit this page View Source

Quality

The quality of the laser beam.

Declaration
public int Quality { get; set; }
Property Value
Type Description
int
| Edit this page View Source

Spread

The angle in degrees the laser should spread out.

Declaration
public float Spread { get; set; }
Property Value
Type Description
float
| Edit this page View Source

Sprite

Gets or sets the sprite of the laser beam.

Declaration
public Sprite Sprite { get; set; }
Property Value
Type Description
Sprite
| Edit this page View Source

SpriteOffset

Gets the sprite offset of the laser beam.

Declaration
public Vector2 SpriteOffset { get; }
Property Value
Type Description
Vector2
| Edit this page View Source

SpriteScale

Gets the sprite scale of the laser beam.

Declaration
public Vector2 SpriteScale { get; }
Property Value
Type Description
Vector2
| Edit this page View Source

StartingWidth

How wide the laser should be at the start.

Declaration
public float StartingWidth { get; set; }
Property Value
Type Description
float
| Edit this page View Source

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)
| Edit this page View Source

TextureContactPoints

Returns the texture contact points of the laser beam.

Declaration
public List<Vector2> TextureContactPoints { get; }
Property Value
Type Description
List<Vector2>
| Edit this page View Source

TextureStretch

The stretch factor for the laser beam texture.

Declaration
public float TextureStretch { get; set; }
Property Value
Type Description
float
| Edit this page View Source

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)
| Edit this page View Source

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)

Extension Methods

ReflectionUtilities.ReflectCallMethod(object, string, object[], BindingFlags)
ReflectionUtilities.ReflectGetField(object, string, BindingFlags)
ReflectionUtilities.ReflectGetMethod(object, string, BindingFlags)
ReflectionUtilities.ReflectGetProperty(object, string, BindingFlags)
ReflectionUtilities.ReflectSetField(object, string, object, BindingFlags)
ReflectionUtilities.ReflectSetProperty(object, string, object, BindingFlags)
CoroutineUtilities.RunCoroutineWhile<T>(T, IEnumerator, Func<bool>)
  • Edit this page
  • View Source
☀
☾
In this article
Back to top
Generated by DocFX
☀
☾