Пример #1
0
        public void CompletePuzzle()
        {
            if (completed)
            {
                return;
            }

            completed = true;
            Debug.Log("Block Push Puzzle Completed");
            OnPuzzleCompleted?.Invoke();
        }
Пример #2
0
        public void TileFlipped(IntPair position)
        {
            if (GetIndex(position) == -1)
            {
                return;
            }

            //center
            FlipTile(position);
            //up
            FlipTile(new IntPair(position.x, position.y + 1));
            //right
            FlipTile(new IntPair(position.x + 1, position.y));
            //down
            FlipTile(new IntPair(position.x, position.y - 1));
            //left
            FlipTile(new IntPair(position.x - 1, position.y));

            if (PuzzleIsCompleted())
            {
                OnPuzzleCompleted?.Invoke();
                Debug.Log("Tile Lights Puzzle Completed");
            }
        }
Пример #3
0
 protected void OnPuzzleComplete()
 {
     Game.WorkingOnPuzzle = false;
     OnPuzzleCompleted?.Invoke();
 }