Table of Contents

Class Trigger

Namespace
FrameOfReference.World.Positionables
Assembly
FrameOfReference.World.dll

Executes Lua scripts on proximity or timers.

public sealed class Trigger : Positionable<Vector2>, ICloneable, IChangeNotify<Positionable<Vector2>>
Inheritance
Positionable<Vector2>
Trigger
Implements
Inherited Members
Extension Methods

Properties

DependsOn

The name of another Trigger that has to be triggered before this one can be.

public string? DependsOn { get; set; }

Property Value

string

DueTime

The GameTime by which this trigger should have been activated.

public double DueTime { get; set; }

Property Value

double

OnActivation

A Lua script to execute when TargetEntity gets within Range.

[FileType("Lua")]
public string? OnActivation { get; set; }

Property Value

string

OnTimeout

A Lua script to execute if the trigger was not activated by DueTime.

[FileType("Lua")]
public string? OnTimeout { get; set; }

Property Value

string

Range

The maximum distance at which an Entity activates this trigger.

public float Range { get; set; }

Property Value

float

TargetEntity

The name of the Entity whose proximity causes this trigger to activate.

public string? TargetEntity { get; set; }

Property Value

string

WasTriggered

Indicates whether this trigger has already been triggered by TargetEntity or has timed out.

public bool WasTriggered { get; set; }

Property Value

bool

Methods

IsInRange(Positionable<Vector2>)

Determines whether an entity is within range of this trigger.

public bool IsInRange(Positionable<Vector2> entity)

Parameters

entity Positionable<Vector2>

Returns

bool