Unity Stopping PlayMode After Yield Instruction

Viewed 16

I have a system which can generate asset bundles + generate asset preview picture(.png) and packed to zip result. GameObjects injected to Creator in Editor Mode and Creator initiated enabling\disabling PlayMode and do all logic in him.

But sometimes on my colleague machine it doesn't work... without any visible reasons. Log is clear and didn't have errors. Last what I see everytime - it is log before "yield" instruction in coroutine. And after that "PlayMode Exit" log.

I re-checked all.

  • GameObject 100% is active when coroutine working.
  • Unity Editor Logs also doesn't contain any lines about errors. But I don't have any idea whats wrong... is possible this is unique problem on PC?

Here is my code and last place what can write log before exiting from PlayMode https://pastebin.com/w7VnjFFk

private IEnumerator DelayedCameraPositionAndSnapshot()
{
    Debug.Log("AssetPreviewCreator.DelayedCameraPositionAndSnapshot()");

    //Change object position for clear snapshot
    _previousAssetPosition = _targetAssetObject.transform.position;
    
    Vector3 assetPosition = _previousAssetPosition;
    assetPosition.x -= 600f;
    _targetAssetObject.transform.position = assetPosition;
    
    Debug.Log("AssetPreviewCreator.DelayedCameraPositionAndSnapshot() before delay");

    yield return new WaitForSeconds(0.5f);

    Debug.Log("AssetPreviewCreator.DelayedCameraPositionAndSnapshot() after delay");
0 Answers
Related