Skip to content

OverrideHandle

public struct OverrideHandle : IDisposable

Namespace TightBeam.Api

A scoped, per-field override on the flashlight for one owner. Set fields to drive the beam; Clear or Dispose to release them and let the player’s own settings show through. Safe no-op if TightBeam is absent.

Example

Dim and narrow the beam while the player is inside a zone:

OverrideHandle zone = Beam.BeginOverride("MyMod").SetIntensity(1f).SetSpotAngle(28f);
// on leaving the zone
zone.Dispose();
public OverrideHandle SetIntensity(float v)

Overrides the intensity until it is cleared.

Parameter
vThe Unity light intensity, e.g. 1. It is not held to MinIntensity and MaxIntensity; below 0 shows as 0.
public OverrideHandle SetRange(float m)

Overrides the range until it is cleared.

Parameter
mThe range in metres. The drawn beam stays between 2 and 60.
public OverrideHandle SetSpotAngle(float deg)

Overrides the cone angle until it is cleared.

Parameter
degThe full cone angle in degrees, e.g. 28. The drawn beam stays between 8 and 90.
public OverrideHandle SetColor(float r, float g, float b, float a = 1f)

Overrides the colour until it is cleared.

Parameter
rRed, 0 to 1.
gGreen, 0 to 1.
bBlue, 0 to 1.
aAlpha, 0 to 1. The default is 1.
public OverrideHandle ClearIntensity()
public OverrideHandle ClearRange()
public OverrideHandle ClearSpotAngle()
public OverrideHandle ClearColor()
public void Dispose()