void Update() { _components.RemoveAll(x => x == null); if (_components.Where(x => x.name == "EndGoal" && x.Connected == true).Any()) { if (_components.Where(x => x.name.ToUpper().Contains("START")).Count() > 1) { if (_components.Where(x => x.name.ToUpper().Contains("SISTOR") && x.Connected == true).Count() == 0) { return; } } EngComponent block = _components.Where(x => x.name == "EndGoal").First(); if (block.GetType().IsAssignableFrom(typeof(BaseCircuit))) { BaseCircuit actualBlock = (BaseCircuit)block; if (actualBlock.Current >= RequiredPower) { PuzzleDone(CarriagePuzzleController.PuzzleType.T2D); UI.ShowMessage("The circuit appears to be conducting electricity once more!"); TwoDimensionalUIController.UI.ValidateInventory(); UI.Hide2DPuzzle(); } } } }
void Update() { _components.RemoveAll(x => x == null); if (_components.Where(x => x.name == "EndGoal" && x.Connected == true).Any()) { if (_components.Where(x => x.name.ToUpper().Contains("START")).Count() > 1) { if (_components.Where(x => x.name.ToUpper().Contains("SISTOR") && x.Connected == true).Count() == 0) { return; } } EngComponent block = _components.Where(x => x.name == "EndGoal").First(); if (block.GetType().IsAssignableFrom(typeof(BaseCircuit))) { BaseCircuit actualBlock = (BaseCircuit)block; if (actualBlock.Current >= RequiredPower) { Destroy(gameObject); } } } }