private void UpdateWalledMode() { if (WalledModeIgnore.Value) { _hexMapEditor.SetWalledMode(0); } else if (WalledModeYes.Value) { _hexMapEditor.SetWalledMode(1); } else if (WalledModeNo.Value) { _hexMapEditor.SetWalledMode(2); } }
public IEnumerator chooseAndSetWallsTest() { 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); HexMapEditor.OptionalToggle walled = HexMapEditor.OptionalToggle.Yes; editor.SetWalledMode((int)walled); editor.HandleTestInput(cell); Assert.AreEqual(walled, editor.walledMode); foreach (GameObject g in go) { GameObject.Destroy(g); } SceneManager.UnloadScene("Scene"); }