public IEnumerator SetUp() { // Load Test scene AsyncOperation sceneLoading = SceneManager.LoadSceneAsync("TestScene", LoadSceneMode.Single); // Wait for scene to load float timer = 0; while (!sceneLoading.isDone) { if (timer > 15f) { break; } timer += Time.deltaTime; yield return(new WaitForEndOfFrame()); } Assert.IsTrue(sceneLoading.isDone, "Scene load timed out! The scene could not be loaded."); if (_inputMock is null) { _inputMock = new PlayerInputMock(); } // Enable required components GameObject.Find("GameManager").SetActive(true); GameObject.Find("Main Camera").SetActive(true); }
public IEnumerator SetUp() { // Load Test scene AsyncOperation sceneLoading = SceneManager.LoadSceneAsync("TestScene", LoadSceneMode.Single); // Wait for scene to load float timer = 0; while (!sceneLoading.isDone) { if (timer > 15f) { break; } timer += Time.deltaTime; yield return(new WaitForEndOfFrame()); } Assert.IsTrue(sceneLoading.isDone, "Scene load timed out! The scene could not be loaded."); // Setup controllers for all possible players for (int i = 0; i < MaxPlayers; i++) { if (_inputMocks[i] is null) { _inputMocks[i] = new PlayerInputMock(i); } } }