Skip to main content

RandomTimedActionComponent

An abstract class in Root.Township, Alta.Intelligence.

Base for AI action components that run for a random length of time, set in the inspector (5 to 7 seconds by default).

Constructors​

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

Fields​

2 private and internal fields
MemberWhat it is
private float maximumDurationBacking field for MaximumDuration (default 7 seconds).
private float minimumDurationBacking field for MinimumDuration (default 5 seconds).

Properties​

MemberWhat it is
float MaximumDuration { get; }Upper bound of the random duration, in seconds.
float MinimumDuration { get; }Lower bound of the random duration, in seconds.
float RandomDuration { get; }A fresh random value between the minimum and maximum each time it is read.