// Update is called once per frame void Update() { if (!triggersFinished[0] && ConversationTrigger.tokens.Contains("dreshaReadyToFlashFinishedImage2")) { triggersFinished[0] = true; // first event: Dresha flashes finished image, which triggers next convo highlighter.HighlightTimed(finishedImage, 2); ConversationTrigger.AddToken("dreshaFlashedFinishedImage2"); } else if (!triggersFinished[1] && ConversationTrigger.tokens.Contains("dreshaReadyToFlashPartButtons")) { triggersFinished[1] = true; // second event: Dresha flashes part buttons highlightPartButtons(1f); enablePartButtons(); } else if (ConversationTrigger.GetToken("wrongRotationDreshaReadyToFlashObj")) { // Dresha flashes selected obj and then lets the player try again highlightSelectedObj(1f); ConversationTrigger.AddToken("dreshaFlashedSelectedObj2"); } else if (ConversationTrigger.GetToken("playerAttachedWrongFace") && !ConversationTrigger.GetToken("wrongFaceDreshaReadyToFlashBox")) { // wrong shape - Dresha just finished tryDifferentShape1 and // will now flash box and part menu for 2 seconds highlightPartButtons(2f); highlighter.HighlightTimed(GameObject.Find("longbox"), 2); } else if (ConversationTrigger.GetToken("showNextLevelButton2")) { StartCoroutine(waitAndEnableGoToNextLevel()); } if (fuseEvent.done() && !done) { // player wins! // Dresha talks about next level // next level should not load until player finishes this convo //move conversation box to center //conversationSystem.GetComponent<RectTransform>().pivot = new Vector2(0.5f,1); //conversationSystem.GetComponent<RectTransform>().anchorMin = new Vector2(0.5f,1); //conversationSystem.GetComponent<RectTransform>().anchorMax = new Vector2(0.5f,1); //conversationSystem.GetComponent<RectTransform>().localPosition = new Vector3(0, 0, 0); // wait till convo is finished to display congrats text ConversationTrigger.AddToken("showNextLevelButton2"); } }
// Update is called once per frame void Update() { // first event: Dresha flashes finished image, which triggers next convo if (!triggersFinished[0] && ConversationTrigger.tokens.Contains("dreshaReadyToFlashFinishedImage")) { triggersFinished[0] = true; highlighter.HighlightTimed(finishedImage, 2); ConversationTrigger.AddToken("dreshaFlashedFinishedImage"); // second event: Dresha creates Pyr, which triggers next convo } else if (!triggersFinished[1] && ConversationTrigger.tokens.Contains("dreshaReadyToCreatePyr")) { triggersFinished[1] = true; StartCoroutine(createPyrWait()); // third event: Dresha rotates Pyr left, then down } else if (!triggersFinished[2] && ConversationTrigger.tokens.Contains("dreshaReadyToRotatePyr")) { triggersFinished[2] = true; StartCoroutine(rotatePyrWait()); // fourth event: Dresha highlights the two black regions: Pyr's and the corresponding fuseTo on the cube } else if (!triggersFinished[3] && ConversationTrigger.tokens.Contains("dreshaReadyToPointToBlackRegions")) { triggersFinished[3] = true; StartCoroutine(pointToBlackRegionsWait()); // fifth event: Dresha's failed connect attempt with error message } else if (!triggersFinished[4] && ConversationTrigger.tokens.Contains("dreshaReadyToTryAttaching")) { triggersFinished[4] = true; StartCoroutine(tryAttachPyrWait()); // sixth event: Welder interface fizzes to life and all controls are enabled } else if (!triggersFinished[5] && ConversationTrigger.tokens.Contains("dreshaReadyToEnableControls")) { triggersFinished[5] = true; StartCoroutine(enableInterfaceWait()); } else if (!triggersFinished[6] && ConversationTrigger.tokens.Contains("dreshaReadyToFlashPyrButton")) { triggersFinished[6] = true; // seventh event: Dresha flashes part buttons ("Click on this!") // highlight until button is clicked foreach (Button b in partButtons) { Highlighter.Highlight(b.gameObject); } ConversationTrigger.AddToken("dreshaFlashedPyrButton"); } else if (!triggersFinished[7] && ConversationTrigger.tokens.Contains("dreshaReadyToFlashPyr")) { triggersFinished[7] = true; //player has already clicked Pyr button and has just started talking about the Pyr's black part //eighth event: Dresha flashes selectedObj foreach (Button b in partButtons) { Highlighter.Unhighlight(b.gameObject); } highlightSelectedObj(); // highlight until is face is selected } else if (!triggersFinished[8] && ConversationTrigger.tokens.Contains("dreshaReadyToFlashBox")) { triggersFinished[8] = true; //ninth event: Dresha flashes Box Highlighter.Highlight(GameObject.Find("box")); ConversationTrigger.AddToken("dreshaFlashedBox"); } else if (!triggersFinished[9] && ConversationTrigger.tokens.Contains("playerReadyToMoveCamera") && Input.GetMouseButtonDown(0)) { triggersFinished[9] = true; unhighlightSelectedObj(); Highlighter.Unhighlight(GameObject.Find("box")); //tenth event: player just depressed mouse key to begin dragging camera // figure out later how to get this to work for an actual drag ConversationTrigger.AddToken("playerMovedCamera"); } else if (!triggersFinished[10] && ConversationTrigger.tokens.Contains("dreshaReadyToFlashBoxAgain")) { triggersFinished[10] = true; Highlighter.Highlight(GameObject.Find("box")); // highlight until its face is selected } else if (triggersFinished[10] && !triggersFinished[11] && selectPart.getSelectedFuseTo() != null) { triggersFinished[11] = true; // player has selected a FuseTo Highlighter.Unhighlight(GameObject.Find("box")); ConversationTrigger.AddToken("playerSelectedAFuseTo"); } else if (!triggersFinished[12] && ConversationTrigger.tokens.Contains("dreshaReadyToFlashPyrAgain")) { triggersFinished[12] = true; // Dresha has just told player to select the selectedObj's attachment highlightSelectedObj(1f); } else if (!triggersFinished[13] && triggersFinished[12] == true && selectPart.getSelectedObject() != null) { triggersFinished[13] = true; // player just selected pyr's attachment (or some other selectedObject, if we're allowing different shapes highlightSelectedObj(1f); ConversationTrigger.AddToken("playerSelectedAnObj"); } else if (!triggersFinished[14] && ConversationTrigger.tokens.Contains("dreshaReadyToFlashConnectButton")) { triggersFinished[14] = true; // Dresha will now flash connect button and explain it Highlighter.Highlight(connectButton.gameObject); ConversationTrigger.AddToken("dreshaFlashedConnectButton"); } else if (!triggersFinished[15] && ConversationTrigger.tokens.Contains("dreshaReadyToFlashGizmo")) { triggersFinished[15] = true; // Dresha will now flash rotation gizmo and explain it Highlighter.Unhighlight(connectButton.gameObject); StartCoroutine(highlightGizmoWait()); } else if (!triggersFinished[16] && ConversationTrigger.tokens.Contains("dreshaReadyToFlashPyrAfterGizmo")) { triggersFinished[16] = true; // Dresha will now flash selectedObj once again highlightSelectedObj(1f); ConversationTrigger.AddToken("dreshaFlashedPyrAfterGizmo"); } else if (!triggersFinished[17] && ConversationTrigger.tokens.Contains("readyToEnableConnectButton")) { triggersFinished[17] = true; //turn tutorial mode off - this restores normal functionality of connect button //this also enables connect button - Dresha is already talking selectPart.setTutorialOn(false); } else if (!triggersFinished[18] && ConversationTrigger.GetToken("wrongRotationDreshaReadyToFlashObj")) { // Dresha flashes selected obj and then lets the player try again highlightSelectedObj(1f); ConversationTrigger.AddToken("wrongRotationDreshaFlashedObj"); } else if (triggersFinished[17] && ConversationTrigger.GetToken("playerAttachedWrongFace") && !ConversationTrigger.GetToken("wrongFaceDreshaReadyToFlashBox")) { // wrong shape - Dresha just finished tryDifferentShape1 and // will now flash box and part menu for 2 seconds highlightPartButtons(); highlighter.HighlightTimed(GameObject.Find("box"), 1); } else if (ConversationTrigger.GetToken("showNextLevelButton")) { StartCoroutine(waitAndEnableGoToNextLevel()); } if (fuseEvent.done() && !done) { // player wins! // Dresha talks about next level // next level should not load until player finishes this convo done = true; ConversationTrigger.AddToken("playerFinishedTutorial1"); } }