void Start() { //DontDestroyOnLoad(gameObject); // initialize pieceTypeSelected currentPieceTypeSelected = Constants.NONE_SELECTED; lastPieceTypeSelected = Constants.NONE_SELECTED; gameController = GameObject.Find("GameManager").GetComponent <MainGameController>(); gameController.currentScene = Constants.EXPLAINER_SCENE; levelNumber = gameController.levelNumber; if (gameController.tutorial) { explainerHouse = new ConstructedHouse(4, 2, 0, 1); } else { if (levelNumber == 1) { explainerHouse = new ConstructedHouse(4, 1, 0, 1); } if (levelNumber == 2) { explainerHouse = new ConstructedHouse(4, 1, 1, 1); } if (levelNumber == 3) { explainerHouse = new ConstructedHouse(4, 1, 1, 2); } if (levelNumber == 4) { explainerHouse = new ConstructedHouse(4, 1, 2, 2); } } // set up the scene SetUpExplainerScene(); // enable drag and drop functionality EnableDragAndDropGameplay(); // turn off the buttons explainerCompleteButton.SetActive(false); //switchToBuilderButton.SetActive (false); // subscribe to appropriate events Slot.OnPieceAddedToHouse += ExplainerPieceAddedToHouse; DragHandler.OnPieceRemovedByTrash += ExplainerPieceRemoved; wall_piece_type = Constants.TYPE_WALL_NONE; tutorial_step = 0; gameController.SendRobotUtterance("child-building-tutorial", true, -1, -1, -1); }
// Use this for initialization void Start() { gameController = GameObject.Find("GameManager").GetComponent <MainGameController>(); if (gameController.scene == Constants.ROBOT_GUESSING_SCENE) { guess = GameObject.Find("RobotGuessingManager").GetComponent <RobotGuesser>(); childbuilder = GameObject.Find("ExplainerSceneManager").GetComponent <ChildBuilder>(); guessedHouse = guess.finalHouse; builtHouse = childbuilder.explainerHouse; gameController.SendRobotUtterance("child-builder-compare-houses", false, -1, -1, -1); /*var cl = GameObject.Find("child_left"); * var rr = GameObject.Find("robot_right"); * * cl.gameObject.GetComponent<Text>().enabled = true; * rr.gameObject.GetComponent<Text>().enabled = true;*/ } else if (gameController.scene == Constants.CHILD_GUESSING_SCENE) { if (gameController.tutorial) { childTut = GameObject.Find("ChildGuessingManager").GetComponent <ChildGuesserTutorial>(); correct = childTut.chosenHouse; guessed = childTut.submittedHouse; } else { child = GameObject.Find("ChildGuessingManager").GetComponent <ChildGuesser>(); correct = child.chosenHouse; guessed = child.submittedHouse; } gameController.SendRobotUtterance("robot-builder-compare-houses", false, -1, -1, -1); /*var cr = GameObject.Find("child_right"); * var rl = GameObject.Find("robot_left"); * * cr.gameObject.GetComponent<Text>().enabled = true; * rl.gameObject.GetComponent<Text>().enabled = true;*/ } level = gameController.levelNumber; showOnScreen(); }