// Use this for initialization void Start() { manager = GameObject.Find ("EddieMinigame").GetComponent<EddiePuzzleManager> (); sceneCamera = GameObject.Find ("Camera").camera; //startPos = this.transform.position; setStartPos (); uiTexture = GetComponent<UITexture> (); }
// 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); } }
// Vector3 offset = new Vector3(-100,0,0); //bool moved = false; void Start() { EddiePuzzleManagerScript = manager.GetComponent<EddiePuzzleManager>(); }