IEnumerator FinishTask4() { yield return(new WaitForSeconds(0.8f)); overallManager.startTask5(); overallManager.destroyStuff(this.gameObject); }
IEnumerator FinishTask5() { yield return(new WaitForSeconds(0.8f)); Helper.transform.LookAt(Helper.transform.position + new Vector3(-0.2f, 0, 0)); iTween.MoveTo(Helper, iTween.Hash("position", NextPlace, "easetype", iTween.EaseType.easeInOutSine)); yield return(new WaitForSeconds(0.8f)); overallManager.startTask6(); overallManager.destroyStuff(this.gameObject); }
IEnumerator HelperFlyToIsland() { yield return(new WaitForSeconds(1f)); Helper.transform.LookAt(Helper.transform.position + new Vector3(-0.2f, 0, 0)); iTween.MoveTo(Helper, iTween.Hash("position", islandPosition, "easetype", iTween.EaseType.easeInOutSine)); yield return(new WaitForSeconds(0.5f)); overallManager.startTask4(); overallManager.destroyStuff(this.gameObject); }
// Update is called once per frame void Update() { Billboard.GetComponent <BillboardManager>().SetDebugInfo("Task 0 - State: " + substate); switch (substate) { case 1: if (!state1Passed) { state1Passed = true; Talker.GetComponent <SPHelperTalk>().Speak(VOs[0]); } if (Talker.GetComponent <SPHelperAnimation>().FinishedTalking()) { substate = 2; } break; case 2: Talker.GetComponent <SPHelperTalk>().Speak(VOs[1]); Controller.canControl = true; Controller.controlMode = 0; Controller.SkipButtonFlash(); substate = 3; break; case 3: if (Talker.GetComponent <SPHelperAnimation>().FinishedTalking()) { overallManager.startTask1(); overallManager.destroyStuff(this.gameObject); } break; } }
// Update is called once per frame void Update() { Billboard.GetComponent <BillboardManager>().SetDebugInfo("Task 1 - State: " + substate); switch (substate) { case 1: Talker.GetComponent <SPHelperTalk>().Speak(Task1VOs[0]); Billboard.HighLight(0); Controller.ChangeControlMode(); Controller.controlMode = 1; Controller.rightHandHoverUI.GetComponentInChildren <UnityEngine.UI.Text>().text = "Move Mode"; substate = 2; break; case 2: if (FirstMoveDetector.IfTouched()) { // 1st island lose 1 health. StartCoroutine(BreakCrystal(firstCrystal)); // play VO good job, then go get item StartCoroutine(finishAndGo()); substate = 3; } break; case 3: if (SecondMoveDetector.IfTouched()) { // crystal break and island fall islandPosBeforeFall = islandToFall.transform; StartCoroutine(BreakCrystal(secondCrystal)); StartCoroutine(IslandFall()); // VO island HP Talker.GetComponent <SPHelperTalk>().Speak(Task1VOs[3]); substate = 4; } break; case 4: if (talkerAnim.FinishedTalking()) { // VO move again Talker.GetComponent <SPHelperTalk>().Speak(Task1VOs[4]); // island with full health return islandToReturn.SetActive(true); iTween.MoveTo(islandToReturn, iTween.Hash("position", islandPosBeforeFall, "easetype", iTween.EaseType.easeInOutSine)); Walker.SetActive(true); substate = 5; } break; case 5: if (ThirdMoveDetector.IfTouched()) { // 3st island lose 1 health. StartCoroutine(BreakCrystal(thirdCrystal)); Walker.transform.LookAt(Walker.transform.position + new Vector3(-0.2f, 0, 0)); // helper look at player // VO got item, helper fly Talker.GetComponent <SPHelperTalk>().Speak(Task1VOs[5]); AudioCenter.PlayGetItem(); StartCoroutine(HelperFlyToInventory()); // turn off moving Controller.rightHandHoverUI.GetComponentInChildren <UnityEngine.UI.Text>().text = "Hold on..."; // item appear on inv HealItemOnBoard.SetActive(false); Inventory.SetActive(true); HealItemOnInv.SetActive(true); substate = 6; } break; case 6: if (talkerAnim.FinishedTalking()) { Billboard.Check(0); Talker.GetComponent <SPHelperTalk>().Speak(Task1VOs[6]); substate = 7; } break; case 7: if (talkerAnim.FinishedTalking()) { substate = 8; } break; case 8: overallManager.startTask2(); overallManager.destroyStuff(this.gameObject); break; } }