IEnumerator PlayDoorAnimation(CameraTransition cam) { Animator anim = cam.transform.parent.GetComponent <Animator>(); cam.enabled = true; yield return(new WaitForSeconds(2.0f)); cam.MoveToNewPosition(); yield return(new WaitForSeconds(cam.smoothTime + 0.6f)); anim.SetTrigger("Open"); //door_Opening_Sound.Play(); audioSource.Play(); yield return(new WaitForSeconds(3.0f)); audioSource.Stop(); cam.MoveToOldPosition(); yield return(new WaitForSeconds(cam.smoothTime)); cam.enabled = false; playInt.can_Interact = true; //door_Opening_Sound.Stop(); }
IEnumerator PlayDoorAnimation(Animator anim, string triggerParameter) { has_Been_Solved = true; CameraTransition camTrans = anim.transform.GetChild(0).GetComponent <CameraTransition>(); camTrans.enabled = true; yield return(new WaitForSeconds(1.2f)); camTrans.MoveToNewPosition(); yield return(new WaitForSeconds(camTrans.smoothTime + 0.6f)); anim.SetTrigger(triggerParameter); //door_Opening_Sound.Play(); audioSource.Play(); yield return(new WaitForSeconds(3.0f)); audioSource.Stop(); camTrans.MoveToOldPosition(); yield return(new WaitForSeconds(camTrans.smoothTime)); camTrans.enabled = false; playInt.can_Interact = true; //door_Opening_Sound.Stop(); }
/* * //For testing * void Update() { * if (Input.GetKeyDown(KeyCode.Q)) * { * puzzle_Solved = true; * Debug.Log("solved"); * StartCoroutine(Open_Door()); * } * }*/ IEnumerator Open_Door() { camTrans.enabled = true; yield return(new WaitForSeconds(5.8f)); camTrans.MoveToNewPosition(); yield return(new WaitForSeconds(camTrans.smoothTime + 0.6f)); //start playing sound door_Opening_Sound.Play(); temple_Door.GetComponent <Animator>().SetTrigger("Open"); for (int i = 0; i < door_Rubble_Particles.Length; i++) { door_Rubble_Particles[i].Play(); } yield return(new WaitForSeconds(4.0f)); for (int i = 0; i < door_Rubble_Particles.Length; i++) { door_Rubble_Particles[i].Stop(); } camTrans.MoveToOldPosition(); yield return(new WaitForSeconds(camTrans.smoothTime)); camTrans.enabled = false; playInt.can_Interact = true; door_Opening_Sound.Stop(); //stop playing sound }
/// <summary> /// Disables player movement and input and then calls the next cutscene from alist of unlockable cutscenes /// </summary> /// <returns></returns> IEnumerator PlayCutscene() { camTrans.enabled = true; camTrans.charController.canMove = false; yield return(new WaitForSeconds(0.4f)); camTrans.MoveToNewPosition(); yield return(new WaitForSeconds(camTrans.smoothTime)); cutsceneEvent.Invoke(); }
IEnumerator PlayFinalAnimation() { camTrans.enabled = true; yield return(new WaitForSeconds(1.2f)); camTrans.MoveToNewPosition(); yield return(new WaitForSeconds(camTrans.smoothTime + 0.6f)); anim.enabled = true; anim.SetTrigger("Temple_Trap_Finish"); GameObject.FindWithTag("Scene_Manager").GetComponent <ProgressManager>().TempleCompleted(1); }
IEnumerator Puzzle_Solved() { camTrans.enabled = true; yield return(new WaitForSeconds(5.8f)); camTrans.MoveToNewPosition(); yield return(new WaitForSeconds(3f)); //local_Fade_To_Black.Fade_Out(); local_Scene_Management.GetComponent <ProgressManager>().TempleCompleted(0); StartCoroutine(GetComponent <Change_Scene_Trigger>().LoadNewScene()); //yield return new WaitForSeconds(1.5f); //local_Scene_Management.Load_Scene("Hub Scene"); }
IEnumerator PlayDoorAnimation(CameraTransition cam) { //Debug.Log(System.Array.IndexOf(camTrans, cam)); Animator anim = null; if (cam.transform.parent.GetComponent <Animator>() != null) { anim = cam.transform.parent.GetComponent <Animator>(); } cam.enabled = true; yield return(new WaitForSeconds(2.0f)); cam.MoveToNewPosition(); yield return(new WaitForSeconds(cam.smoothTime + 0.6f)); if (anim != null) { anim.SetTrigger("Open"); } //door_Opening_Sound.Play(); if (System.Array.IndexOf(camTrans, cam) != camTrans.Length - 1) { audioSource.Play(); } yield return(new WaitForSeconds(1.0f)); if (System.Array.IndexOf(camTrans, cam) == camTrans.Length - 1) { if (!is_Final_Temple) { StartCoroutine(GetComponent <Change_Scene_Trigger>().LoadNewScene()); } } yield return(new WaitForSeconds(2.0f)); //door_Opening_Sound.Stop(); audioSource.Stop(); cam.MoveToOldPosition(); yield return(new WaitForSeconds(cam.smoothTime)); cam.enabled = false; playInt.can_Interact = true; }
IEnumerator PlayDoorAnimation() { camTrans.enabled = true; yield return(new WaitForSeconds(2.0f)); camTrans.MoveToNewPosition(); yield return(new WaitForSeconds(camTrans.smoothTime + 0.6f)); yield return(new WaitForSeconds(1.2f)); camTrans.MoveToOldPosition(); yield return(new WaitForSeconds(camTrans.smoothTime)); camTrans.enabled = false; playInt.can_Interact = true; }
IEnumerator PlayDoorAnimation(CameraTransition cam) { Animator anim = null; if (cam.transform.parent.GetComponent <Animator>() != null) { anim = cam.transform.parent.GetComponent <Animator>(); } cam.enabled = true; yield return(new WaitForSeconds(2.0f)); cam.MoveToNewPosition(); yield return(new WaitForSeconds(cam.smoothTime + 0.6f)); if (anim != null) { anim.SetTrigger("Open"); } //door_Opening_Sound.Play(); audioSource.Play(); if (cam == camTrans[camTrans.Length - 1]) { StartCoroutine(GetComponent <Change_Scene_Trigger>().LoadNewScene()); } yield return(new WaitForSeconds(3.0f)); audioSource.Stop(); cam.MoveToOldPosition(); yield return(new WaitForSeconds(cam.smoothTime)); cam.enabled = false; playInt.can_Interact = true; //door_Opening_Sound.Stop(); }