void Start()
        {
            // set up the scene
            gameController.SetUpExplainerScene();
            gameController.PlaceExistingRocketPiecesOnRocketOutlines();

            // enable drag and drop functionality
            gameController.EnableDragAndDropGameplay();

            // initialize the buttons
            if (gameController.IsRocketComplete())
            {
                builderCompleteButton.SetActive(true);
            }
            else
            {
                builderCompleteButton.SetActive(false);
            }
            switchToExplainerButton.SetActive(true);

            // have the rocket label (child/caregiver) represent the true state of the game
            if (gameController.childExplainer)
            {
                playerIndicatorText.text = Constants.CAREGIVER_ROCKET_STRING;
            }
            else
            {
                playerIndicatorText.text = Constants.CHILD_ROCKET_STRING;
            }

            // display the appropriate text in the tutorial button
            if (gameController.tutorialMode == Constants.TUTORIAL_ON)
            {
                tutorialButton.SetActive(true);
            }
            else if (gameController.tutorialMode == Constants.TUTORIAL_OFF)
            {
                tutorialButton.SetActive(false);
            }

            // subscribe to appropriate events
            Slot.OnPieceAddedToRocket         += BuilderPieceAddedToRocket;
            DragHandler.OnPieceRemovedByTrash += BuilderPieceRemoved;
        }
예제 #2
0
        void Start()
        {
            // if it's our first time entering this scene, set up the screen for the explainer
            // to build their rocket
            if (gameController.explainerMode == Constants.EXPLAINER_BUILDING)
            {
                // set up the scene
                gameController.SetUpExplainerScene();

                // enable drag and drop functionality
                gameController.EnableDragAndDropGameplay();

                // turn off the buttons
                explainerCompleteButton.SetActive(false);
                switchToBuilderButton.SetActive(false);

                // hide the tutorial highlights
                HideAllTutorialHighlights();

                // subscribe to appropriate events
                Slot.OnPieceAddedToRocket         += ExplainerPieceAddedToRocket;
                DragHandler.OnPieceRemovedByTrash += ExplainerPieceRemoved;

                // set the tutorial state and say the first tutorial prompt
                if (gameController.tutorialMode == Constants.TUTORIAL_ON)
                {
                    tutorialState = Constants.TUTORIAL_STATE_TOUCH_BODY_FRAME;
                    gameController.SendRobotUtterance("tutorial-02-touch-body-pieces", false);
                    ShowOneTutorialHighlight(bodyOutlineTutorialHighlights);
                }
            }
            // if the explainer is going back to this scene to explain their rocket to the builder
            else
            {
                // set up the scene
                gameController.SetUpExplainerScene();
                gameController.PlaceExistingRocketPiecesOnRocketOutlines();
                gameController.DisableTouchOfRocketPieces();

                // show the swap button, not the completed building button
                explainerCompleteButton.SetActive(false);
                switchToBuilderButton.SetActive(true);

                // hide the tutorial highlights
                HideAllTutorialHighlights();

                // set the tutorial state
                if (gameController.tutorialMode == Constants.TUTORIAL_ON)
                {
                    tutorialState = Constants.TUTORIAL_STATE_END;
                }
            }

            // have the rocket label (child/caregiver) represent the true state of the game
            if (gameController.childExplainer)
            {
                playerIndicatorText.text = Constants.CHILD_ROCKET_STRING;
            }
            else
            {
                playerIndicatorText.text = Constants.CAREGIVER_ROCKET_STRING;
            }

            // display the appropriate text in the tutorial button
            if (gameController.tutorialMode == Constants.TUTORIAL_ON)
            {
                tutorialButton.SetActive(true);
            }
            else if (gameController.tutorialMode == Constants.TUTORIAL_OFF)
            {
                tutorialButton.SetActive(false);
            }
        }