Ejemplo n.º 1
0
    private void DoorState()
    {
        switch (v_doorState)
        {
        case S_Door.Closed:
            break;

        case S_Door.Opening:
            if (!I_camera.v_staticNewPos)     //checks when the camera has just arrived to the target(this.position)
            {
                if (TimerWithouTimeScale())
                {
                    Time.timeScale = 1f;
                    I_camera.ChangeStaticTarget(false);
                    print("ESPUTOFALSO");
                    ChangeDoorState(v_doorState, S_Door.Opened);
                }
                //TO DO ANIMACION
            }



            break;

        case S_Door.Opened:
            break;
        }
    }
Ejemplo n.º 2
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     I_camera.ChangeStaticTarget(true, boss.transform.position);
     I_camera.v_smoothSpeed   = vAux_newSmooth;
     vAux_playerHasColisioned = true;
     Vibration.instance.CameraForTheBoss();
     MusicManager.instance.ChangeSong(musicBoss);
     LevelManager.instance.GetComponent <AudioSource>().volume = 0.4f;
     LevelManager.instance.v_pausedLevel = true;
     Time.timeScale            = 0.01f;
     playerAudioSource.enabled = false;
 }
Ejemplo n.º 3
0
    // Update is called once per frame
    void Update()
    {
        if (!v_zoomReady)
        {
            i_canvas.SetActive(false);
            i_blackBackground.SetActive(true);
            Time.timeScale = Mathf.Lerp(Time.timeScale, 0, Time.deltaTime);

            v_zoomTimer -= Time.unscaledDeltaTime;

            if (v_zoomTimer <= 0)
            {
                MenuSound();
                Camera.main.orthographicSize = Mathf.Lerp(Camera.main.orthographicSize, v_deathZoom, v_speed * Time.unscaledDeltaTime);

                foreach (GameObject light in LevelManager.instance.L_lightingSystem)
                {
                    if (light.activeSelf == true)
                    {
                        light.SetActive(false);
                    }
                }

                if (!vAux_targetSelected)
                {
                    Vector3 l_targetPosition = i_player.position + new Vector3(0, v_verticalOffset);
                    i_cameraMovement.ChangeStaticTarget(true, l_targetPosition);
                    vAux_targetSelected = true;
                }

                if (Camera.main.orthographicSize - v_deathZoom < 0.02f)
                {
                    Time.timeScale = 0;
                    v_zoomReady    = true;
                }
            }
        }
    }