1. var Red : Light;
2. var Green : Light;
3. var Yellow : Light;
4.
5. function Start()
6. {
7.
8. Yellow.enabled = false;
9.
10. while(true)
11. {
12. Green.enabled = true;
13. Red.enabled = false;
14. yield WaitForSeconds(30);
15. Yellow.enabled = true;
16 .Green.enabled = false;
17. yield WaitForSeconds(3.7);
18. Red.enabled = true;
19. Yellow.enabled = false;
20. yield WaitForSeconds (20);
21. }
22.
23. }
I am working on a script for blankout LEDs and trolley signals. I've worked on a script that invovled in intersection and an adjacent RR crossing with the traffic lights cooperating with the crossing signals.
@Michiel, please allow traffic light routine scripts into the simulator.
Just Some Edited Traffic Light Scripting
Moderator: senjer
- Sgt_DeBones
- Posts: 655
- Joined: 05 Apr 2019, 15:23
- Location: Los Angeles, California
Just Some Edited Traffic Light Scripting
Light Rail rapid transit (Tram-train) > Metro