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();
    }
Exemplo n.º 2
0
    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();
    }
Exemplo n.º 3
0
    /*
     *  //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
    }
Exemplo n.º 4
0
    private IEnumerator TrapCutsceneEnumerator()
    {
        gOs[0].SetActive(true);
        yield return(new WaitForSeconds(1.2f));

        StartCoroutine(gOs[1].GetComponent <Trap_Triggers>().Activated_Trap(true));
        yield return(new WaitForSeconds(2.0f));

        camTrans.MoveToOldPosition();
        gOs[0].SetActive(false);
        yield return(new WaitForSeconds(3.0f));

        camTrans.enabled = false;
        PlayerPrefs.SetInt("trap_Cutscene_Triggered", 1);
    }
Exemplo n.º 5
0
    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;
    }
Exemplo n.º 6
0
    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;
    }
Exemplo n.º 7
0
    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();
    }