Cannot restart an IEnumerator without a valid Reset function
Chaleeshadow opened this issue · 2 comments
Hello Thank for Svelto.ECS i am a newbie.
I tried to with Photon,Yeah it so excellent but I don't know solve problem "Cannot restart an IEnumerator without a valid Reset function, use SetEnumeratorProvider instead" Occurs when player host room disconnected already other players will get this error
my code adapt from Svelto.ECS.Examples.Survival What should i do to solve this problem?
Thanks
there are several ways to solve the problem, but I need to see the code to be sure. If you are using a task routine, don't use a SetEnumerator, but use a SetEnumeratorProvider with a function that returns the enumerator and not the enumerator itself. This is the simples way to do it, although it would allocate a new enumerator every time the task is restarted.
Thanks. I get it change to SetEnumeratorProvider!!