I’m still fighting windmills trying to create ReplayCoroutine method for my CoroutineManager. My question is mostly based for IEnumerators:
If I pass and IEnumerator in a method
CoroutineNode ReplayCoroutine(CoroutineNode cn)
and have a custom class
public class CoroutineNode
{
public fiber;
public fiberToCopy;
public CoroutineNode(IEnumerator _fiber)
{
this.fiber = _fiber;
this.fiberToCopy = _fiber;
}
public CoroutineNode(CoroutineNode cn)
{
fiber = cn.fiber;
fiberToCopy = cn.fiberToCopy;
}
}
and now when I want to copy I pass not the fiber, but fiberToCopy which then this new CoroutineNode should have IEnumerators that are not iterated yet since its a copy of the original one. Is value of IEnumerator passed by ref or value?
I’ve read a bunch of stuff on msdn and as I get it most people tend not to fu** with IEnumerators in a way I am trying to do it. Any help is appreciated!