What about C#?
EDIT: Ok, it seems I didn't express myself correctly. My question is hypothetical, let's say you didn't have the WaitForSeconds class available and you needed to create it from scratch. How would you program a class that had the same behavior as the class provided by Unity?
answered Mar 03 '10 at 12:54 AM
in C# you should add System.Collections to your namespaces. also you define a coroutine by returning an IEnumerator.
2f or 2.5f means that the number is a float and not a double or int. you should return an instance of WaitForSecond in C#. see this pages for more info. http://unity3d.com/support/documentation/ScriptReference/index.Writing_Scripts_in_Csharp.html http://unity3d.com/support/documentation/ScriptReference/index.Coroutines_26_Yield.html
answered Mar 02 '10 at 08:46 PM
just put this in the function where ever you need it to stop for a while:
yield WaitForSeconds(4); //4 being the number of seconds you want
answered Mar 02 '10 at 08:37 PM