I have a prefab called "trafficLight", it has a js script called "setlights" and that script has a function called "SetLight(state)"
I have lots of trafficLight gameobjects in my scene.
How do I access the function SetLight(n) from any other script (or animation event) in my scene so that all traffic lights get updated at the same time?
asked Sep 29 '10 at 11:47 AM
If you are using C#, you can create a static List() in the setlights class, and add the current object into it. You can then traverse this list.
answered Oct 14 '10 at 01:46 PM
Worked out the answer just after asking
answered Sep 29 '10 at 11:58 AM