Hi! I’m a newbie and think BOO’s great.
So I have some test try to put a Coroutine Function into a Variable.
What’s the “Coroutine couldn’t be started!”. Please?
There script has been copyed and changed form Unity3d Document.
http://unity3d.com/support/documentation/ScriptReference/MonoBehaviour.StartCoroutine.html
import UnityEngine
import System.Collections
class Parent (MonoBehaviour):
public cmd as callable(single) as IEnumerator
def Awake ():
cmd = WaitAndPrint
return
def Start ():
print(('Starting ' + Time.time))
StartCoroutine('cmd', 2.0)
//Coroutine 'cmd' couldn't be started!
//UnityEngine.MonoBehaviour:StartCoroutine(String, Object)
//Test:Start() (at Assets/Test.boo:15)
print(('Before WaitAndPrint Finishes ' + Time.time))
def WaitAndPrint(waitTime as single) as IEnumerator :
yield WaitForSeconds(waitTime)
print(('WaitAndPrint ' + Time.time))
Any help will be deeply appreciated.