private IEnumerator InitEvent() { while (RenderSettings.ambientIntensity > 0) { RenderSettings.ambientIntensity -= 0.01f; yield return(new WaitForSeconds(0.01f)); } playermirr.SetActive(false); eventState = "CLOSED"; robot.playNextAction(); }
public void notifyAnswer(int answer) { quizzHasStarted = false; if (answer == -1) { return; } if (answer == expectedAnswer) { source.Stop(); source.clip = dingding; source.Play(); expectedAnswer = -1; if (questions.Count == 0) { youWin(); return; } StartCoroutine(setUpNewQuestion()); } else { source.Stop(); source.clip = dzz; source.Play(); quizzPanel.transform.DOScale(0, 0.2f); RobotScheduler.stringContainer sC = new RobotScheduler.stringContainer() { expressions = new List <RobotScheduler.stringContainer.faceExpression>() { RobotScheduler.stringContainer.faceExpression.FRUSTR }, strings = new List <string>() { "How...too bad..." } }; robot.stringContainersQueue.Enqueue(sC); robot.queueAc.Enqueue(RobotScheduler.EventAction.TALK); robot.playNextAction(); groundFloor.SetActive(false); } }
public IEnumerator unravel(HatScript chosenHat) { StartCoroutine(hats[0].moveTo(new Vector3(hats[0].transform.position.x, hats[0].transform.position.y + 50, hats[0].transform.position.z), 1f)); StartCoroutine(hats[1].moveTo(new Vector3(hats[1].transform.position.x, hats[1].transform.position.y + 50, hats[1].transform.position.z), 1f)); StartCoroutine(hats[2].moveTo(new Vector3(hats[2].transform.position.x, hats[2].transform.position.y + 50, hats[2].transform.position.z), 1f)); yield return(new WaitForSeconds(1f)); if (chosenHat != goodHat) { bottomPit.SetActive(false); RobotScheduler robot = GameObject.FindGameObjectWithTag("Robot").GetComponent <RobotScheduler>(); robot.stringContainersQueue.Enqueue(new RobotScheduler.stringContainer() { strings = new List <string>() { "Ohhh...too bad !" }, expressions = new List <RobotScheduler.stringContainer.faceExpression> { RobotScheduler.stringContainer.faceExpression.FRUSTR } }); robot.queueAc.Enqueue(RobotScheduler.EventAction.TALK); robot.playNextAction(); } else { RobotScheduler robot = GameObject.FindGameObjectWithTag("Robot").GetComponent <RobotScheduler>(); robot.stringContainersQueue.Enqueue(new RobotScheduler.stringContainer() { strings = new List <string>() { "Well done !" }, expressions = new List <RobotScheduler.stringContainer.faceExpression> { RobotScheduler.stringContainer.faceExpression.HAPPY } }); robot.queueAc.Enqueue(RobotScheduler.EventAction.TALK); robot.playNextAction(); RenderSettings.ambientIntensity = 1.2f; } }
public void notify(string name) { string expected = orderExpected.Dequeue(); if (name != expected) // The player made a mistake { orderExpected.Clear(); numberTing -= 1; tries += 1; source.clip = bzz; source.Play(); robot.stringContainersQueue.Enqueue(new RobotScheduler.stringContainer() { strings = new List <string>() { "Oooh...too bad...", "Let's try again !" }, expressions = new List <RobotScheduler.stringContainer.faceExpression> { RobotScheduler.stringContainer.faceExpression.FRUSTR, RobotScheduler.stringContainer.faceExpression.HAPPY } }); robot.queueAc.Enqueue(RobotScheduler.EventAction.TALK); robot.queueAc.Enqueue(RobotScheduler.EventAction.EVENT); robot.playNextAction(); } else { if (orderExpected.Count == 0) { if (tries <= 0) // Game is won; { foreach (GameObject go in pillars) { go.GetComponent <LightPillar>().IEmit(); } flag.SetActive(true); robot.stringContainersQueue.Enqueue(new RobotScheduler.stringContainer() { strings = new List <string>() { "You did it ! You're the best !" }, expressions = new List <RobotScheduler.stringContainer.faceExpression> { RobotScheduler.stringContainer.faceExpression.HAPPY } }); robot.queueAc.Enqueue(RobotScheduler.EventAction.TALK); source.clip = poof; source.Play(); robot.playNextAction(); } else { source.clip = ding; source.Play(); StartCoroutine(setUpScene()); } } } }