Esempio n. 1
0
    // Use this for initialization
    void Start()
    {
        // Find assocciated minigame
        minigame = GetComponent<Minigame>();

        tutorialHand = GameObject.Find ("TutorialHand");
        tutorialHand.SetActive(false);

        currLevel = 0;
        foreach(DifficultySession ds in difficultySessions) {
            if(ds.difficulty == minigame.difficulty) {
                currentDifficultySession = ds;
                break;
            }
        }

        setupGame();

        if(!minigame.isStandalone()) //if the minigame is part of the story, not free play mode
        {
            Destroy(tutorialOptions);
            if(!showTutorial)
            {
                setupLevel();
                disableAllKeys();
            }

            // Show the instructions of the minigame
            if (minigame != null && minigame.StartConversation() == false)
            {
                Debug.Log("S: Let's get this lock open!");
            }

            Invoke("continueDialogue", minigame.GetCurrentDialogueDuration());
        }

        if (minigame.minigameEndEvent != null)
            minigame.minigameEndEvent.location = null;
    }
    // Use this for initialization
    void Start()
    {
        wrongTries = 0;
        Instance = this;

        Sherlock.Instance.SetBubblePosition (Sherlock.side.DOWN);

        correctSlotRef = -1;

        phase = 0;

        cont = false;
        puzzleComplete = false;
        hintGiven = false;
        hintAsked = false;

        //shuffle the puzzles
        System.Random rng = new System.Random();
        int n = myPuzzles.Length;
        while (n > 1) {
            n--;
            int k = rng.Next(n + 1);
            GameObject value = myPuzzles[k];
            PuzzleImageType sol = mySolutions[k];
            myPuzzles[k] = myPuzzles[n];
            mySolutions[k] = mySolutions[n];
            myPuzzles[n] = value;
            mySolutions[n]  = sol;
        }
        mySolutions[0].SetActive(false);

        // Find assocciated minigame
        minigame = GetComponent<Minigame>();

        switch (minigame.difficulty)
        {
        case MinigameDifficulty.Difficulty.EASY:
            myPuzzles[0].GetComponent<UITexture>().mainTexture = easyOutline;
            myPuzzles[0].GetComponent<PuzzlePieceTextureMod>().puzzleOutline = easyColored;
            totalPieces = 6;
            break;
        case MinigameDifficulty.Difficulty.MEDIUM:
            myPuzzles[0].GetComponent<UITexture>().mainTexture = medOutline;
            myPuzzles[0].GetComponent<PuzzlePieceTextureMod>().puzzleOutline = medColored;
            totalPieces = 12;
            break;
        case MinigameDifficulty.Difficulty.HARD:
            myPuzzles[0].GetComponent<UITexture>().mainTexture = hardOutline;
            myPuzzles[0].GetComponent<PuzzlePieceTextureMod>().puzzleOutline = hardColored;
            totalPieces = 20;
            break;
        }

        for(int j = 1; j<myPuzzles.Length; j++)
        {
            myPuzzles[j].SetActive(false);
            mySolutions[j].SetActive(false);

            switch (minigame.difficulty)
            {
            case MinigameDifficulty.Difficulty.EASY:
                myPuzzles[j].GetComponent<UITexture>().mainTexture = easyOutline;
                myPuzzles[j].GetComponent<PuzzlePieceTextureMod>().puzzleOutline = easyColored;
                break;
            case MinigameDifficulty.Difficulty.MEDIUM:
                myPuzzles[j].GetComponent<UITexture>().mainTexture = medOutline;
                myPuzzles[j].GetComponent<PuzzlePieceTextureMod>().puzzleOutline = medColored;
                break;
            case MinigameDifficulty.Difficulty.HARD:
                myPuzzles[j].GetComponent<UITexture>().mainTexture = hardOutline;
                myPuzzles[j].GetComponent<PuzzlePieceTextureMod>().puzzleOutline = hardColored;
                break;
            }
        }

        buttons.SetActive(false);
        hintButton.SetActive(false);

        tutorialHand = GameObject.Find("TutorialHand");
        tutorialHand.SetActive(false);
        tutorialObject = GameObject.Find("PuzzlePiece");
        tutorialObject.SetActive(false);
        tutorialSlot = GameObject.Find("PuzzleSlot");
        tutorialSlot.SetActive(false);

        // Show the instructions of the minigame
        /*if (minigame != null && minigame.StartConversation() == false)
        {
            Debug.Log("S: Knowing when to laugh is puzzling. Complete each puzzle and choose whether you should laugh, or you should help, the people in the image.");
        }
        */
        //minigame.StartConversation();

        if(!minigame.isStandalone()) //if the minigame is part of the story, not free play mode
        {
            Destroy(tutorialOptions);
            Sherlock.Instance.PlaySequenceInstructions(minigame.conversationTree.root, null);
            if(showTutorial)
                StartCoroutine("startTutorial");
            else
                Invoke ("startGame", minigame.conversationTree.root.GetCommulativeDuration() + 1.5f);
        }
    }
Esempio n. 3
0
    // Use this for initialization
    void Start()
    {
        Random.seed = (int) (System.DateTime.UtcNow.Ticks % int.MaxValue);

        // Find assocciated minigame
        minigame = GetComponent<Minigame>();
        Sherlock.Instance.SetBubblePosition(Sherlock.side.DOWN);

        interestOptionsRoot.SetActive(false);
        hiddenObjectsRoot.SetActive(false);

        tutorialHand = GameObject.Find ("TutorialHand").GetComponent<TutorialHand>();

        currentLevel = -1;
        ShuffleCharacters();
        ResetDisplayObjects();

        Sherlock.Instance.HideDialogue();

        if(!minigame.isStandalone()) //if the minigame is part of the story, not free play mode
        {
            Destroy(tutorialOptions);
            if(showTutorial)
            {
                // Show the instructions of the minigame
                if (minigame != null && minigame.StartConversation() == false)
                {
                    Debug.Log("To learn other peoples’ interests, use your eyes to find clues about them.");
                }
                StartCoroutine("startTutorial");
            }
            else
            {
                // Show the instructions of the minigame
                if (minigame != null && minigame.StartConversation() == false)
                {
                    Debug.Log("To learn other peoples’ interests, use your eyes to find clues about them.");
                }
                Invoke ("InitializeFirstLevel", minigame.GetCurrentDialogueDuration());
            }
        }
    }
Esempio n. 4
0
    // Use this for initialization
    void Start()
    {
        phase = 0;
        //Debug.Log("Phase: " + phase);

        notepad.SetActive(false);
        cont = true;

        myLevels = new GameObject[numLevels];
        myAnswers = new GameObject[numLevels];
        //find first level, or MaxLevel0
        //myLevels[0] = GameObject.Find("MaxLevel0");
        //fill up myLevels with remaining
        //int i = 1;

        for (int i = 0 ; i < numLevels ; i++)//(GameObject.Find("MaxLevel" + i.ToString()) !=null)
        {
            myLevels[i] = GameObject.Find("MaxLevel" + i.ToString());
            foreach(Transform child in myLevels[i].transform)
            {
                child.gameObject.SetActive(false);
            }
            myAnswers[i] = GameObject.Find("Answer" + i.ToString());

            myAnswers[i].SetActive(false);

        }

        for(int i = 0; i<3; i++)
        {
            crosses[i].SetActive(false);
        }

        // Find assocciated minigame
        minigame = GetComponent<Minigame>();

        tutorialHand = GameObject.Find ("TutorialHand");
        tutorialHand.SetActive(false);

        tutorialObject = GameObject.Find("TutorialObject");
        tutorialObject.SetActive(false);

        notepad.SetActive(true);
        checkmark.SetActive(false);
        phase = 1;
        currLevel = 0;

        PlayAnimation (NPCAnimations.AnimationIndex.NEUTRAL);

        if(!minigame.isStandalone()) //if the minigame is part of the story, not free play mode
        {
            Destroy(tutorialOptions);
            // Show the instructions of the minigame
            if (minigame != null && minigame.StartConversation() == false)
            {
                Debug.Log("S: Let's help Max make new choices based on what he already likes. Max will give you a description for each category, you choose something similar.");
            }

            Invoke("continueDialogue", minigame.GetCurrentDialogueDuration());

            //StartCoroutine(WaitForInput("startGame"));
            //Invoke ("startGame", minigame.conversationTree.root.GetCommulativeDuration() + 1.5f);
        }
    }
    // Use this for initialization
    void Start()
    {
        answersList = new List<string>();
        topicSelectorList = new List <int>();
        Sherlock.Instance.SetBubblePosition (Sherlock.side.DOWN);

        tutorialHand.SetActive(false);

        // Find assocciated minigame
        minigame = GetComponent<Minigame>();

        //minigame.difficulty = MinigameDifficulty.Difficulty.EASY;

        switch (minigame.difficulty)
        {
            //total = 4
        case MinigameDifficulty.Difficulty.EASY:
            correctTopics = 1;
            maxNumberIncorrectTopics = 3;
            break;

            //total = 6
        case MinigameDifficulty.Difficulty.MEDIUM:
            correctTopics = 2;
            maxNumberIncorrectTopics = 4;
            break;

            //total = 8
        case MinigameDifficulty.Difficulty.HARD:
            correctTopics = 3;
            maxNumberIncorrectTopics = 5;
            break;
        }

        completeList = new List<List<Texture>>();
        completeList.Add(foodTextureList);
        completeList.Add(feetTextureList);
        completeList.Add(readTextureList);
        completeList.Add(sportsTextureList);
        completeList.Add(vehiclesTextureList);
        completeList.Add(weatherTextureList);

        for(int i = 0; i < 6; i++)
            topicSelectorList.Add(i);

        //SelectTopicsOfConversation();
        int counter = 0;
        foreach(UITexture friend in friends)
        {
            setFriendAnimation(NPCAnimations.AnimationIndex.IDLE,friendsAnims[counter]);
            friend.transform.parent.gameObject.SetActive(false);
            counter++;
        }

        setFriendAnimation(NPCAnimations.AnimationIndex.IDLE, gabyAnim);

        wheel.transform.parent.FindChild("ThoughtBubble").gameObject.SetActive(false);

        Sherlock.Instance.HideDialogue();

        if(!minigame.isStandalone()) //if the minigame is part of the story, not free play mode
        {
            Destroy(tutorialOptions);

            showTutorial = !ApplicationState.Instance.presentationBuild;
            if (ShowDialogue(DialogueType.START) == false)
            {
                Debug.Log("Starting!!");
            }
        }
    }
Esempio n. 6
0
    // Use this for initialization
    void Start()
    {
        // Find assocciated minigame
        minigame = GetComponent<Minigame>();
        MinigameDifficulty.Difficulty difficulty = minigame.difficulty;

        // Initialize levels array
        myLevels = new GameObject[numLevels];

        // Easy or medium assets
        if(minigame.difficulty != MinigameDifficulty.Difficulty.HARD) {

            foodsAtlas = (UIAtlas) Resources.Load ("NPCs/Amy/AmyLargeFoodBuffetAtlas", typeof(UIAtlas));

            // Gets all large foods
            foreach(string s in foodsAtlas.GetListOfSprites()) {
                if(s.Contains("dess")) {
                    dessertItems.Add (s);
                } else if(s.Contains("app")) {
                    appetizerItems.Add (s);
                } else if(s.Contains("main")) {
                    mainItems.Add (s);
                }
            }

            // Randomizes the possible appetizer foods
            for(int appRandomizer = 0; appRandomizer < appetizerItems.Count; appRandomizer++) {
                int randomindex = Random.Range(appRandomizer, appetizerItems.Count - 1);
                string swap = (string)appetizerItems[randomindex];
                appetizerItems[randomindex] = appetizerItems[appRandomizer];
                appetizerItems[appRandomizer] = swap;
            }

            // Randomizes the possible main foods
            for(int mainRandomizer = 0; mainRandomizer < mainItems.Count; mainRandomizer++) {
                int randomindex = Random.Range(mainRandomizer, mainItems.Count - 1);
                string swap = (string)mainItems[randomindex];
                mainItems[randomindex] = mainItems[mainRandomizer];
                mainItems[mainRandomizer] = swap;
            }

            // Randomizes the possible dessert foods
            for(int dessertRandomizer = 0; dessertRandomizer < dessertItems.Count; dessertRandomizer++) {
                int randomindex = Random.Range(dessertRandomizer, dessertItems.Count - 1);
                string swap = (string)dessertItems[randomindex];
                dessertItems[randomindex] = dessertItems[dessertRandomizer];
                dessertItems[dessertRandomizer] = swap;
            }
        }

        // Hard assets
        if(minigame.difficulty == MinigameDifficulty.Difficulty.HARD) {

            foodsAtlas = (UIAtlas) Resources.Load ("NPCs/Amy/AmySmallFoodBuffetAtlas", typeof(UIAtlas));

            // Gets all large foods
            foreach(string s in foodsAtlas.GetListOfSprites()) {
                if(s.Contains("dess")) {
                    dessertItems.Add (s);
                } else if(s.Contains("app")) {
                    appetizerItems.Add (s);
                } else if(s.Contains("main")) {
                    mainItems.Add (s);
                }
            }

            // Randomizes the possible appetizer foods
            for(int appRandomizer = 0; appRandomizer < appetizerItems.Count; appRandomizer++) {
                int randomindex = Random.Range(appRandomizer, appetizerItems.Count - 1);
                string swap = (string)appetizerItems[randomindex];
                appetizerItems[randomindex] = appetizerItems[appRandomizer];
                appetizerItems[appRandomizer] = swap;
            }

            // Randomizes the possible main foods
            for(int mainRandomizer = 0; mainRandomizer < mainItems.Count; mainRandomizer++) {
                int randomindex = Random.Range(mainRandomizer, mainItems.Count - 1);
                string swap = (string)mainItems[randomindex];
                mainItems[randomindex] = mainItems[mainRandomizer];
                mainItems[mainRandomizer] = swap;
            }

            // Randomizes the possible dessert foods
            for(int dessertRandomizer = 0; dessertRandomizer < dessertItems.Count; dessertRandomizer++) {
                int randomindex = Random.Range(dessertRandomizer, dessertItems.Count - 1);
                string swap = (string)dessertItems[randomindex];
                dessertItems[randomindex] = dessertItems[dessertRandomizer];
                dessertItems[dessertRandomizer] = swap;
            }
        }

        // Get all the foods in the target trays
        ArrayList targetFoodsSmall = new ArrayList();
        foreach(Transform targetFood in smallTargetTray.transform) {
            if(!targetFood.gameObject.name.Contains("Tray")) {
                targetFoodsSmall.Add (targetFood.gameObject);
            }
        }
        ArrayList targetFoodsLarge = new ArrayList();
        foreach(Transform targetFood in largeTargetTray.transform) {
            if(!targetFood.gameObject.name.Contains("Tray")) {
                targetFoodsLarge.Add (targetFood.gameObject);
            }
        }

        // Remove two plates from the target trays
        for(int randomInt = 0; randomInt < 2; randomInt++) {
            int randomIndex = Random.Range(0, targetFoodsSmall.Count - 1);
            GameObject targetFoodToRemove = ((GameObject)targetFoodsSmall[randomIndex]).gameObject;
            targetFoodToRemove.SetActive(false);
            targetFoodsSmall.Remove(targetFoodToRemove);
            GameObject targetFoodToRemoveLarge = largeTargetTray.transform.FindChild(targetFoodToRemove.name).gameObject;
            targetFoodToRemoveLarge.SetActive(false);
            targetFoodsLarge.Remove(targetFoodToRemoveLarge);
        }

        // Get dropspots from player tray
        GameObject[] dropspots = new GameObject[5];
        for(int dropspotsCounterOne = 0; dropspotsCounterOne < 5; dropspotsCounterOne++)
            dropspots[dropspotsCounterOne] = playerTray.transform.FindChild("Slot" + (dropspotsCounterOne + 1).ToString()).gameObject;

        // Get all levels in the scene
        int i = 0;
        moveDistace.x = buffetTexture.transform.localScale.x;
        while(i < myLevels.Length)
        {
            Transform t = buffet.transform.FindChild("BuffetLevel" + i.ToString());
            if (t != null)
            {
                myLevels[i] = t.gameObject;

                // Get all food items in the current level
                ArrayList foods = new ArrayList();

                // Easy difficulty, 4 items
                if(difficulty == MinigameDifficulty.Difficulty.EASY) {
                    for(int easyCounter = 0; easyCounter < 4; easyCounter++) {
                        GameObject newFood = (GameObject) Instantiate(buffetItem);
                        newFood.transform.parent = myLevels[i].transform;
                        newFood.transform.localPosition = new Vector3(-250 + easyCounter * 90, 290 - easyCounter % 2 * 200, 10);
                        newFood.transform.localScale = new Vector3(2, 2, 2);
                        newFood.transform.FindChild("Buffet_ItemHard1").gameObject.SetActive(false);
                        newFood.transform.FindChild("Buffet_ItemHard2").gameObject.SetActive(false);
                        GameObject newFoodItem = newFood.transform.FindChild("Buffet_ItemEasy").gameObject;
                        newFoodItem.GetComponent<UISprite>().atlas = foodsAtlas;
                        for(int dropspotsCounter = 0; dropspotsCounter < 5; dropspotsCounter++)
                            newFood.GetComponent<DraggableObjectBuffet>().dropspots[dropspotsCounter] = dropspots[dropspotsCounter];
                        switch(i) {
                        case 0:
                            newFoodItem.GetComponent<UISprite>().spriteName = (string)appetizerItems[easyCounter];
                            break;
                        case 1:
                            newFoodItem.GetComponent<UISprite>().spriteName = (string)mainItems[easyCounter];
                            break;
                        case 2:
                            newFoodItem.GetComponent<UISprite>().spriteName = (string)dessertItems[easyCounter];
                            break;
                        default:
                            newFood.GetComponent<UISprite>().spriteName = (string)appetizerItems[easyCounter];
                            break;
                        }
                        foods.Add(newFood);
                    }
                }

                // Medium difficulty, 8 items
                if(difficulty == MinigameDifficulty.Difficulty.MEDIUM) {
                    for(int mediumCounter = 0; mediumCounter < 8; mediumCounter++) {
                        GameObject newFood = (GameObject) Instantiate(buffetItem);
                        newFood.transform.parent = myLevels[i].transform;
                        newFood.transform.localPosition = new Vector3(-370 + mediumCounter * 77 - (mediumCounter % 2)*30, 260 - mediumCounter % 2 * 180, 10);
                        newFood.transform.localScale = new Vector3(2, 2, 2);
                        newFood.transform.FindChild("Buffet_ItemHard1").gameObject.SetActive(false);
                        newFood.transform.FindChild("Buffet_ItemHard2").gameObject.SetActive(false);
                        GameObject newFoodItem = newFood.transform.FindChild("Buffet_ItemEasy").gameObject;
                        newFoodItem.GetComponent<UISprite>().atlas = foodsAtlas;
                        for(int dropspotsCounter = 0; dropspotsCounter < 5; dropspotsCounter++)
                            newFood.GetComponent<DraggableObjectBuffet>().dropspots[dropspotsCounter] = dropspots[dropspotsCounter];
                        switch(i) {
                        case 0:
                            newFoodItem.GetComponent<UISprite>().spriteName = (string)appetizerItems[mediumCounter];
                            break;
                        case 1:
                            newFoodItem.GetComponent<UISprite>().spriteName = (string)mainItems[mediumCounter];
                            break;
                        case 2:
                            newFoodItem.GetComponent<UISprite>().spriteName = (string)dessertItems[mediumCounter];
                            break;
                        default:
                            newFood.GetComponent<UISprite>().spriteName = (string)appetizerItems[mediumCounter];
                            break;
                        }
                        foods.Add(newFood);
                    }
                }

                // Hard difficulty, 8 items split
                if(difficulty == MinigameDifficulty.Difficulty.HARD) {
                    for(int hardCounter = 0; hardCounter < 8; hardCounter++) {
                        GameObject newFood = (GameObject) Instantiate(buffetItem);
                        newFood.transform.parent = myLevels[i].transform;
                        newFood.transform.localPosition = new Vector3(-370 + hardCounter * 77 - (hardCounter % 2)*30, 260 - hardCounter % 2 * 180, 10);
                        newFood.transform.localScale = new Vector3(2, 2, 2);
                        newFood.transform.localEulerAngles = new Vector3(0, 0, 30);
                        newFood.transform.FindChild("Buffet_ItemEasy").gameObject.SetActive(false);
                        GameObject newFoodItem1 = newFood.transform.FindChild("Buffet_ItemHard1").gameObject;
                        newFoodItem1.GetComponent<UISprite>().atlas = foodsAtlas;
                        GameObject newFoodItem2 = newFood.transform.FindChild("Buffet_ItemHard2").gameObject;
                        newFoodItem2.GetComponent<UISprite>().atlas = foodsAtlas;
                        for(int dropspotsCounter = 0; dropspotsCounter < 5; dropspotsCounter++)
                            newFood.GetComponent<DraggableObjectBuffet>().dropspots[dropspotsCounter] = dropspots[dropspotsCounter];
                        int nextHardCounter = hardCounter + 1;
                        if(nextHardCounter >= 8)
                            nextHardCounter = 0;
                        switch(i) {
                        case 0:
                            newFoodItem1.GetComponent<UISprite>().spriteName = (string)appetizerItems[hardCounter];
                            newFoodItem2.GetComponent<UISprite>().spriteName = (string)appetizerItems[nextHardCounter];
                            break;
                        case 1:
                            newFoodItem1.GetComponent<UISprite>().spriteName = (string)mainItems[hardCounter];
                            newFoodItem2.GetComponent<UISprite>().spriteName = (string)mainItems[nextHardCounter];
                            break;
                        case 2:
                            newFoodItem1.GetComponent<UISprite>().spriteName = (string)dessertItems[hardCounter];
                            newFoodItem2.GetComponent<UISprite>().spriteName = (string)dessertItems[nextHardCounter];
                            break;
                        default:
                            newFood.GetComponent<UISprite>().spriteName = (string)appetizerItems[hardCounter];
                            newFoodItem2.GetComponent<UISprite>().spriteName = (string)appetizerItems[nextHardCounter];
                            break;
                        }
                        foods.Add(newFood);
                    }
                }

                // Randomize the order of items in the buffet
                for(int foodsCounter = 0; foodsCounter < foods.Count; foodsCounter++) {
                    int randomindex = Random.Range(foodsCounter, foods.Count - 1);
                    // Swap positions
                    float x = ((GameObject)foods[randomindex]).transform.position.x;
                    float y = ((GameObject)foods[randomindex]).transform.position.y;
                    ((GameObject)foods[randomindex]).transform.position = new Vector3(
                        ((GameObject)foods[foodsCounter]).transform.position.x,
                        ((GameObject)foods[foodsCounter]).transform.position.y,
                        ((GameObject)foods[foodsCounter]).transform.position.z);
                    ((GameObject)foods[foodsCounter]).transform.position = new Vector3(x, y, ((GameObject)foods[foodsCounter]).transform.position.z);
                }

                // Make one item the target food
                GameObject correctFood = (GameObject)foods[Random.Range(0, foods.Count - 1)];
                GameObject correctFoodEasy = correctFood.transform.FindChild("Buffet_ItemEasy").gameObject;
                GameObject correctFoodHard1 = correctFood.transform.FindChild("Buffet_ItemHard1").gameObject;
                GameObject correctFoodHard2 = correctFood.transform.FindChild("Buffet_ItemHard2").gameObject;
                // Update the small and large food tray's plate for easy and medium
                if(difficulty != MinigameDifficulty.Difficulty.HARD) {
                    ((GameObject)targetFoodsSmall[i]).transform.FindChild("Buffet_ItemHard1").gameObject.SetActive(false);
                    ((GameObject)targetFoodsSmall[i]).transform.FindChild("Buffet_ItemHard2").gameObject.SetActive(false);
                    ((GameObject)targetFoodsSmall[i]).transform.FindChild("Buffet_ItemEasy").gameObject.GetComponent<UISprite>().atlas = foodsAtlas;
                    ((GameObject)targetFoodsSmall[i]).transform.FindChild("Buffet_ItemEasy").gameObject.GetComponent<UISprite>().spriteName =
                        correctFoodEasy.GetComponent<UISprite>().spriteName;
                    // Find and update the large food tray's plate
                    foreach(GameObject g in targetFoodsLarge) {
                        if(g.name == ((GameObject)targetFoodsSmall[i]).gameObject.name) {
                            g.transform.FindChild("Buffet_ItemHard1").gameObject.SetActive(false);
                            g.transform.FindChild("Buffet_ItemHard2").gameObject.SetActive(false);
                            g.transform.FindChild("Buffet_ItemEasy").gameObject.GetComponent<UISprite>().atlas = foodsAtlas;
                            g.transform.FindChild("Buffet_ItemEasy").GetComponent<UISprite>().spriteName = correctFoodEasy.GetComponent<UISprite>().spriteName;
                            break;
                        }
                    }
                } else if(difficulty == MinigameDifficulty.Difficulty.HARD) {
                    ((GameObject)targetFoodsSmall[i]).transform.localEulerAngles = new Vector3(0, 0, 30);
                    ((GameObject)targetFoodsSmall[i]).transform.FindChild("Buffet_ItemEasy").gameObject.SetActive(false);
                    ((GameObject)targetFoodsSmall[i]).transform.FindChild("Buffet_ItemHard1").gameObject.GetComponent<UISprite>().atlas = foodsAtlas;
                    ((GameObject)targetFoodsSmall[i]).transform.FindChild("Buffet_ItemHard1").gameObject.GetComponent<UISprite>().spriteName =
                        correctFoodHard1.GetComponent<UISprite>().spriteName;
                    ((GameObject)targetFoodsSmall[i]).transform.FindChild("Buffet_ItemHard2").gameObject.GetComponent<UISprite>().atlas = foodsAtlas;
                    ((GameObject)targetFoodsSmall[i]).transform.FindChild("Buffet_ItemHard2").gameObject.GetComponent<UISprite>().spriteName =
                        correctFoodHard2.GetComponent<UISprite>().spriteName;
                    // Find and update the large food tray's plate
                    foreach(GameObject g in targetFoodsLarge) {
                        if(g.name == ((GameObject)targetFoodsSmall[i]).gameObject.name) {
                            g.transform.localEulerAngles = new Vector3(0, 0, 30);
                            g.transform.FindChild("Buffet_ItemEasy").gameObject.SetActive(false);
                            g.transform.FindChild("Buffet_ItemHard1").GetComponent<UISprite>().atlas = foodsAtlas;
                            g.transform.FindChild("Buffet_ItemHard1").GetComponent<UISprite>().spriteName = correctFoodHard1.GetComponent<UISprite>().spriteName;
                            g.transform.FindChild("Buffet_ItemHard2").GetComponent<UISprite>().atlas = foodsAtlas;
                            g.transform.FindChild("Buffet_ItemHard2").GetComponent<UISprite>().spriteName = correctFoodHard2.GetComponent<UISprite>().spriteName;
                            break;
                        }
                    }
                }
                correctFood.GetComponent<DraggableObjectBuffet>().isSolution = true;
                correctFood.GetComponent<DraggableObjectBuffet>().correctSlot = ((GameObject)targetFoodsSmall[i]).name.Replace("Spot", "");

                myLevels[i].transform.localPosition = moveDistace * i;
            }
            else
                break;

            i++;
        }

        // Find all game objects related the minigame
        largeSample = GameObject.Find("SampleTrayLarge");
        smallSample = GameObject.Find("SampleTraySmall");
        smallSample.SetActive(false);
        smallSampleBubble = GameObject.Find("SampleTrayBubble");
        smallSampleBubble.SetActive(false);
        myTray = GameObject.Find ("PlayerTray");
        myTray.SetActive(false);
        endGame = GameObject.Find ("EndBackground");
        endGame.SetActive(false);
        buffet.SetActive(false);
        tutorialHand = GameObject.Find("TutorialHand");
        tutorialHand.SetActive(false);
        tutorialBuffet = GameObject.Find ("TutorialBuffet");
        tutorialObject = GameObject.Find ("TutorialObject");
        tutorialBuffet.SetActive(false);
        tutorialObject.SetActive(false);

        if(!minigame.isStandalone()) //if the minigame is part of the story, not free play mode
        {
            Destroy(tutorialOptions);
            if(showTutorial)
            {
                largeSample.SetActive(false);
                myTray.SetActive(true);
                tutorialBuffet.SetActive(true);
                StartCoroutine("startTutorial");
            }
            else
            {
                // Show the instructions of the minigame
                if (minigame != null && minigame.StartConversation() == false)
                {
                    Debug.Log("S: This is Amy's original order. She had a garden salad, burger and strawberries. We must remake Amy's lunch exactly as it appears, so choose the RIGHT item, and place it in the RIGHT location.");
                }

                Invoke ("LayBuffet", minigame.GetCurrentDialogueDuration());
            }
        }
    }
Esempio n. 7
0
    void Start()
    {
        Instance = this;

        //changing these to the background sprite to attempt to access their color directly, if it doesn't work,
        //change it back to "MoveRightHandButton" etc.
        userButtons [(int)eType.RIGHT] = new PlayerSprite ("MoveRightHandButton");
        userButtons [(int)eType.LEFT] = new PlayerSprite ("MoveLeftHandButton");
        userButtons [(int)eType.CLAP] = new PlayerSprite ("MoveClapHandButton");
        UpdatePlayerTextures();

        tutorialHand = GameObject.Find("TutorialHand");
        tutorialHand.SetActive(false);

        Sherlock.Instance.SetBubblePosition (Sherlock.side.DOWN);

        // Find assocciated minigame
        minigame = GetComponent<Minigame> ();

        Sherlock.Instance.HideDialogue();

        if(!minigame.isStandalone()) //if the minigame is part of the story, not free play mode
        {
            Destroy(tutorialOptions);
            showTutorial = true;

            // Show the instructions of the minigame
            if (minigame != null && minigame.StartConversation () == false) {
                Debug.Log (minigame.conversationTree.root);
            }

            Invoke("continueDialogue", minigame.GetCurrentDialogueDuration());
            leftLabelOffset = instructionLabelOffset;
            rightLabelOffset = instructionLabelOffset;
            rightLabelOffset.x = -rightLabelOffset.x;

            SetHandColliders(false);
        }
        //noTutorial();
    }