Class LaserEmitter
Used for playing laser animations and other effects on a Laser.
Namespace: WeaverCore.Components
Assembly: WeaverCore.dll
Syntax
public class LaserEmitter : MonoBehaviour
Properties
| Edit this page View SourceChargeUpDuration
Declaration
public float ChargeUpDuration { get; set; }
Property Value
Type | Description |
---|---|
float |
EndDuration
Duration of the laser ending animation
Declaration
public float EndDuration { get; }
Property Value
Type | Description |
---|---|
float |
FireDuration
Declaration
public float FireDuration { get; set; }
Property Value
Type | Description |
---|---|
float |
FiringLaser
Is the laser currently being fired?
Declaration
public bool FiringLaser { get; }
Property Value
Type | Description |
---|---|
bool |
Laser
The laser component used for rendering the laser sprite
Declaration
public Laser Laser { get; }
Property Value
Type | Description |
---|---|
Laser |
MinChargeUpDuration
Gets the duration of the charge up animation
Declaration
public float MinChargeUpDuration { get; }
Property Value
Type | Description |
---|---|
float |
Methods
| Edit this page View SourceChargeUpLaser_P1()
Starts charging up the laser. This function is useful if you want to control when the laser's events are triggered
Declaration
public float ChargeUpLaser_P1()
Returns
Type | Description |
---|---|
float | Returns the minimum duration of the animation |
EndLaser_P3()
Ends the laser. MUST BE CALLED AFTER FireLaser_P2(). This function is useful if you want to control when the laser's events are triggered
Declaration
public float EndLaser_P3()
Returns
Type | Description |
---|---|
float | Returns the duration of the animation |
FireChargeUpOnly()
Fires the charge up animation of the laser only
Declaration
public void FireChargeUpOnly()
FireChargeUpOnlyRoutine()
Fires the charge up animation of the laser only
Declaration
public IEnumerator FireChargeUpOnlyRoutine()
Returns
Type | Description |
---|---|
IEnumerator |
FireLaser()
Fires the laser
Declaration
public void FireLaser()
FireLaserQuick()
Fires the laser with a quick charge-up animation
Declaration
public void FireLaserQuick()
FireLaserQuickRoutine()
Fires the laser with a quick charge-up animation
Declaration
public IEnumerator FireLaserQuickRoutine()
Returns
Type | Description |
---|---|
IEnumerator |
FireLaserRoutine()
Fires the laser
Declaration
public IEnumerator FireLaserRoutine()
Returns
Type | Description |
---|---|
IEnumerator |
FireLaser_P2()
Fires the laser. MUST BE CALLED AFTER ChargeUpLaser_P1(). This function is useful if you want to control when the laser's events are triggered
Declaration
public float FireLaser_P2()
Returns
Type | Description |
---|---|
float | Returns the minimum duration of the animation |
PlayChargeUpInRoutine(float)
Fades into the charge up animation
Declaration
public IEnumerator PlayChargeUpInRoutine(float playDuration)
Parameters
Type | Name | Description |
---|---|---|
float | playDuration | The duration of the charge-up animation |
Returns
Type | Description |
---|---|
IEnumerator |
PlayChargeUpOutRoutine()
Fades out the charge up animation
Declaration
public IEnumerator PlayChargeUpOutRoutine()
Returns
Type | Description |
---|---|
IEnumerator |
StopLaser()
Stops firing the laser
Declaration
public void StopLaser()
StopLaserAfter(float)
Stops firing the laser after a period of time
Declaration
public void StopLaserAfter(float time)
Parameters
Type | Name | Description |
---|---|---|
float | time | The delay before the laser is stopped |