public IEnumerator chooseAndSetSpecialObjectTest() { 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 specialIndex = 1; editor.SetApplySpecialIndex(true); editor.SetSpecialIndex(specialIndex); editor.HandleTestInput(cell); Assert.AreEqual(specialIndex, editor.activeSpecialIndex); foreach (GameObject g in go) { GameObject.Destroy(g); } SceneManager.UnloadScene("Scene"); }
public void SpecialLevelValueChanged() { _hexMapEditor.SetSpecialIndex(SpecialLevel.Value); }