/** * This method progresses through the dfa state given a wire that got cut. * * @param wire - is the wire object that got cut */ public void Traverse(GameObject wire) { if (uiManager.GetState() == UIStateManager.UIStates.GAME) { currentPosition.IsCurrent = false; currentPosition = currentPosition.NextNode(wire.GetComponent <BombWire>().color); if (currentPosition == null) { GameOver(); } else { currentPosition.IsCurrent = true; if (currentPosition == endNode) { LevelWon(); } } } }