public IEnumerator chooseAndSetFarmLevelTest() { SceneManager.LoadScene("Scene", LoadSceneMode.Single); yield return(new WaitForSeconds(1.0f)); GameObject[] go = SceneManager.GetActiveScene().GetRootGameObjects(); HexMapEditor editor = go[3].transform.Find("Hex Map Editor").GetComponent <HexMapEditor>(); HexGrid grid = go[1].gameObject.GetComponent <HexGrid>(); HexGridChunk[] chunks = grid.getHexGridChunks(); HexCell[] cells = chunks[0].getCells(); HexDirection direction = HexDirection.NE; HexCell cell = cells[4].GetNeighbor(direction).GetNeighbor(direction) .GetNeighbor(direction); int farmLevel = 1; editor.SetApplyFarmLevel(true); editor.SetFarmLevel(farmLevel); editor.HandleTestInput(cell); Assert.AreEqual(farmLevel, editor.activeFarmLevel); foreach (GameObject g in go) { GameObject.Destroy(g); } SceneManager.UnloadScene("Scene"); }
public void FarmCheckboxClicked() { _hexMapEditor.SetApplyFarmLevel(FarmEnabled.Value); }