Ejemplo n.º 1
0
 void HandleSolutionNodeStateChange(ColorPuzzleNode node, bool isSolved)
 {
     if (solutionNodes.Contains(node))
     {
         bool prevSolvedState = solved;
         solved = solutionNodes.ToList().TrueForAll(n => n.isSolved);
     }
 }
Ejemplo n.º 2
0
        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);
        }