I’m trying to convert some C# code to javascript/unityscript since that’s what I’ve been working on learning, so I feel more comfortable with it, but the C# code I have uses an IEnumerator in the function and calls GetEnumerator in that function. From what I’ve read, I haven’t really found anything that’s the equivalent of those in javascript/unityscript. So, is there a way for me to covert those over? Or are they simply not supported?
If it helps, the C# code looks like this:
public override IEnumerator scoresCalculation()
{
return new $scoresCalculation$9(this).GetEnumerator();
}
Thanks!
GetEnumerator isn’t C#, it’s .net, and all .net functions are available in all languages. IEnumerator is also not C#. “function ScoresCalculation() : IEnumerator” is the JS equivalent of how the function would be declared, though I don’t really know what it’s supposed to do.
–Eric
I had changed it to this:
function GetEnumerator() : IEnumerator
{
return new scoresCalculation(this).GetEnumerator();
}
but I’m still getting errors saying GetEnumerator is not a member of System.Collections.IEnumerator and the best overload for the method is not compatible with the argument list. So, that combined with not being able to really find any documentation on those two things led me to think that there was either an easier way to do it in unityscript/javascript or that it just doesn’t exist there.
Check the MSDN whenever you have any question on .NET, its the primary and reasonably only solid documentation on the matter of .NET