Do you mean you have something like the code below? That code will not compile because the variable name you pass to the function "notTheSameVarName" is different than the variable name you use in the enumerator "theVar". How is MyOtherMethod supposed to know what theVar is?
IEnumerator MyMethod()
{
var theVar = new int ();
MyOtherMethod (theVar);
yield return WaitForSeconds (5);
}
void MyOtherMethod(int notTheSameVarName)
{
theVar += 1;
}
I could be totally off here depending on what your code is, so posting your enumerator and method code would probably help if that isn’t the case :).