private void OnTriggerEnter(Collider other)
    {
        BlackFader.FadeFromBlack();

        if (portalCounter != null)
        {
            portalCounter.portalCount++;
        }
        else
        {
            Debug.Log("No Portal Counter Was Found In Scene.");
        }

        if (other.CompareTag("Player"))
        {
            other.GetComponentInChildren <JPPlayerCam>().enabled = false;
            //playerCam.enabled = false;

            Vector3 v = other.transform.rotation.eulerAngles;
            Vector3 y = otherPortal.transform.rotation.eulerAngles;

            other.transform.position = otherPortal.transform.position;
            other.transform.rotation = Quaternion.Euler(v.x, y.y, v.z);
            other.GetComponentInChildren <JPPlayerCam>().enabled = true;

            SoundController.instance.PlayClip(portalSound);

            gameObject.SetActive(false);
        }
    }
    private void LevelNotCompleted()
    {
        Debug.Log($"YOU DIDN'T COMPLETE THE LEVEL YOU F**K");

        BlackFader.FadeToBlack();

        RestartMechanic.RestartGame();
    }
 private void Update()
 {
     if (Input.GetMouseButtonDown(0) || Input.anyKey)
     {
         if (BlackFader.ready)
         {
             BlackFader.GoToScene("Scene0", UnityEngine.SceneManagement.LoadSceneMode.Single, 0.5f);
         }
     }
 }
 public static void Die()
 {
     died = true;
     Shaker.SetShakeLengthSpeed(1f, 55f);
     Shaker.Shake(0.12f);
     Reder.MakeRed("dead");
     Time.timeScale = 0.5f;
     AfterGameButtonListeners.year = Year.GetYear();
     BlackFader.GoToScene("AfterGame", UnityEngine.SceneManagement.LoadSceneMode.Single, 1f, Instance.Ressurect, null);
 }
Exemple #5
0
    private void Update()
    {
        if ((transform.position.z > 16f && !called) || Input.GetKeyDown(KeyCode.Return))
        {
            called = true;
            StartCoroutine(IEStopMusic());
            BlackFader.GoToScene("MainMenu", UnityEngine.SceneManagement.LoadSceneMode.Single, 3f);
        }

        transform.position += Vector3.forward * speed * Time.deltaTime;
    }
    private void Update()
    {
        if (Input.GetKeyDown(restartKey))
        {
            RestartMechanic.RestartGame();

            BlackFader.FadeToBlack();
        }


        if (enabled)
        {
            if (Input.GetKeyDown(restartKey))
            {
                RestartMechanic.RestartGame();

                BlackFader.FadeToBlack();
            }

            timeSinceStart += Time.deltaTime;
            timeToBuzzer   -= Time.deltaTime * timeScaleOfTimer;

            txt.text = timeToBuzzer.ToString("F2");

            if (timeToBuzzer <= 0)
            {
                LevelNotCompleted();
            }
        }

        //  timeSinceStart += Time.deltaTime;
        //  timeToBuzzer -= Time.deltaTime * timeScaleOfTimer;

        txt.text = timeToBuzzer.ToString("F2");

        if (timeToBuzzer <= 0)
        {
            LevelNotCompleted();
        }
    }
Exemple #7
0
    public void GameOver(int i)
    {
        if (gameOver)
        {
            return;
        }
        Time.timeScale = 0.5f;
        gameOver       = true;
        if (i == 0)
        {
            Instance.explotionps.Play();
        }
        else
        {
            Instance.explotionfactory.Play();
        }

        TrainMovement.StopMoving();
        BlackFader.GoToScene("GameOver", UnityEngine.SceneManagement.LoadSceneMode.Single, 1.5f);

        // Reset static fields
        Wagon.upgradespeed = 1f;
    }
Exemple #8
0
 public void OnHelp2ButtonListener()
 {
     BlackFader.GoToScene("Help2", UnityEngine.SceneManagement.LoadSceneMode.Single, 0.5f);
 }
Exemple #9
0
 public void OnHowToPlayListener()
 {
     BlackFader.GoToScene("GamePlay", UnityEngine.SceneManagement.LoadSceneMode.Single, 0.5f);
 }
Exemple #10
0
 public void OnMainMenuButtonListener()
 {
     BlackFader.GoToScene("MainMenu", UnityEngine.SceneManagement.LoadSceneMode.Single, 0.5f);
 }
Exemple #11
0
 public void OnCreditsButtonListener()
 {
     BlackFader.GoToScene("Credits", UnityEngine.SceneManagement.LoadSceneMode.Single, 0.5f);
 }
 public void OnPlayButtonListener()
 {
     BlackFader.GoToScene("Game", UnityEngine.SceneManagement.LoadSceneMode.Single, 0.8f);
 }