79505224

Date: 2025-03-13 01:45:57
Score: 0.5
Natty:
Report link

Never had an issue with time being inconsistent across the platforms. It's probably an issue within your save methods themselves.

If these methods perform a heavy operation, such as writing to a file, then they might take more time than the WaitForSeconds you're doing. You see, both InvokeRepeating and IEnumerator allow to do some "parallel" work, but it's not truly parallel. It's still happening on the main thread, so it might freeze the thread for, let's say, 200ms, and your next invocation will be 200ms later.

If you really need to do such heavy work in the background constantly, you might want to consider creating a new real thread - that will do the saving - without taking up your main thread upon which you run the game.

You might also want to attach a remote profiler session to your phone and investigate what it is that eats your framerate.

Additionally, running the same coroutine within the same coroutine like you do is a very ugly line of code :P. Just put the content of the coroutine inside the while(true) loop, and you'll have the same effect.

Reasons:
  • Long answer (-1):
  • No code block (0.5):
  • Low reputation (1):
Posted by: Sygan