示例#1
0
        // Use this for initialization
        IEnumerator Start()
        {
            // Bind to moves
            scanner.OnMove += Scanner_OnMove;
            nextShowStage   = CurrentStage.NumMoves;

            // Wait for a few seconds
            yield return(new WaitForSeconds(waitFor));

            // Show the first stage
            if ((currentStage == 0) && (scanner.NumMoves < nextShowStage))
            {
                stageId = PopUps.ShowNewDialog(CurrentStage.GetMessage(scanner));
            }
        }
示例#2
0
        private void Scanner_OnMove(BlockGridScanner obj)
        {
            // Check if the number of moves exceed the stage
            if ((CurrentStage != null) && (obj.NumMoves >= nextShowStage))
            {
                // Hide the previous message
                PopUps.RemoveDialog(stageId);

                // Increment stage
                ++currentStage;

                // Check if there is a next stage
                if (CurrentStage != null)
                {
                    // Show the next message
                    nextShowStage += CurrentStage.NumMoves;
                    stageId        = PopUps.ShowNewDialog(CurrentStage.GetMessage(scanner));
                }
            }
        }