public IEnumerator UnityTearDown() { input.TearDown(); while (loadedObjects.Count > 0) { var obj = loadedObjects[0]; loadedObjects.RemoveAt(0); if (obj) { Object.Destroy(obj); yield return(null); } } for (var obj = FindObjectToDestroy(); obj; obj = FindObjectToDestroy()) { Object.Destroy(obj); yield return(null); } if (loadedScene.IsValid()) { var operation = SceneManager.UnloadSceneAsync(loadedScene); yield return(new WaitUntil(() => operation == null || operation.isDone)); loadedScene = default; } }
public void Close() { _inputSystem.TearDown(); }