public void Step() { Source.PlayOneShot(StepSound); HashSet <Vector2Int> redSet = new HashSet <Vector2Int>(); HashSet <Vector2Int> greenSet = new HashSet <Vector2Int>(); for (int h = 0; h < gameGrid.Height; ++h) { for (int w = 0; w < gameGrid.Width; ++w) { GameObject g = gameGrid.GetGridComponent(h, w); if (gameGrid.IsOperator(g)) { g.GetComponent <Receiver>().Step(); } } } for (int h = 0; h < gameGrid.Height; ++h) { for (int w = 0; w < gameGrid.Width; ++w) { GameObject g = gameGrid.GetGridComponent(h, w); if (gameGrid.IsOperator(g)) { g.GetComponent <Operator>().Step(); } } } Wire.ResetSignals(); for (int h = 0; h < gameGrid.Height; ++h) { for (int w = 0; w < gameGrid.Width; ++w) { GameObject g = gameGrid.GetGridComponent(h, w); if (gameGrid.IsOperator(g)) { g.GetComponent <Transmitter>().Step(); SpawnEffect(ref redSet, ref greenSet, g.GetComponent <Transmitter>()); } } } if (TestCaseComplete()) { TestCaseCompletion[ColumnManager.TestIndex] = true; if (!IsLevelWon()) { ColManager.OffsetTestIndex(1); SoftReset(); } } if (!levelWon && IsLevelWon()) { SetSimState((int)SimState.PAUSED); levelWon = true; levelWonGroup.EnableUI(); Source.PlayOneShot(WinSound); } }