pKallv
October 23, 2014, 11:32pm
1
Could someone explain to me what i am doing wrong with this code?
I have a function: void DoTemplateFile(List<MaxType>theMaxTypeList) {"
In this function i have: StartCoroutine (gggg());
And I have a coroutine that looks like this:
IEnumerator gggg() {
//testing
}
I get the following Error: TemplateScript.gggg()': not all code paths return a value
This code is a stripped down version as i removed all code in the coo routine when i got the problem to see if i could fix it.
your method ‘gggg’ doesn’t return anything, though it defines a return type. You need to return something.
You could return null.
You could return System.Linq.Enumerable.Empty.GetEnumerator()
You could ‘yield break’, making it an enumeration method
But when you define a return type, you have to return something.
pKallv
October 23, 2014, 11:55pm
3
lordofduct:
your method ‘gggg’ doesn’t return anything, though it defines a return type. You need to return something.
You could return null.
You could return System.Linq.Enumerable.Empty.GetEnumerator()
You could ‘yield break’, making it an enumeration method
But when you define a return type, you have to return something.
Interesting i just found that out myself as i had “yield return newWaitForSeconds(secondsRateToMaxl);” imbedded in the original code and it was when i rewrote it i did not include it. Thanks