Skip to main content

DelayEnable

A class in Root.Township, the global namespace.

Enables a target Behaviour after a random delay when the object starts, so many copies don't all switch on at once.

Constructors​

MemberWhat it is
DelayEnable()Unity makes components itself; use AddComponent or spawn a prefab instead of new.

Fields​

5 private and internal fields
MemberWhat it is
private AnimationCurve curveCurve mode: maps a random 0 to 1 value to the delay in seconds.
private float maximumTimeRange mode: longest delay in seconds.
private float minimumTimeRange mode: shortest delay in seconds.
private DelayEnable.DelayMode modeWhether the delay is picked from a range or from the curve.
private Behaviour targetThe behaviour to enable.

Methods​

1 private and internal method
MemberWhat it is
private IEnumerator Start() (iterator)Waits a random time, from the range or the curve depending on mode, then enables target.