void HandleSolutionNodeStateChange(ColorPuzzleNode node, bool isSolved) { if (solutionNodes.Contains(node)) { bool prevSolvedState = solved; solved = solutionNodes.ToList().TrueForAll(n => n.isSolved); } }
GameObject CreateSmallPuzzlePieces() { GameObject smallPuzzle = Instantiate(this, smallPuzzleParent, false).gameObject; DestroyImmediate(smallPuzzle.GetComponent <ColorPuzzle>()); foreach (Transform t in smallPuzzle.transform) { ColorPuzzleNode node = t.GetComponent <ColorPuzzleNode>(); LightBlocker lightBlocker = t.GetComponent <LightBlocker>(); if (node != null) { DestroyImmediate(node); } if (lightBlocker != null) { DestroyImmediate(lightBlocker); } } return(smallPuzzle); }