A class in Root.Township, the global namespace.
A local component that flips a target GameObject on and off every delay seconds. No networking.
Constructors
| Member | What it is |
|---|
TimedToggle() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
3 private and internal fields
| Member | What it is |
|---|
private float currentTime | Seconds left until the next toggle. Starts at -1 so the first frame toggles straight away. |
private float delay | Seconds between toggles (minimum 0.01). |
private GameObject target | The GameObject whose active state is flipped. |
Methods
1 private and internal method
| Member | What it is |
|---|
private void Update() | Counts down currentTime and toggles target each time it runs out, then restarts the countdown. |