Beispiel #1
0
 // Update is called once per frame
 void Update()
 {
     if (!isMendohlSpawn)
     {
         spawnMendohlTimer += Time.deltaTime;
         if (spawnMendohlTimer > spawnMendohlTime)
         {
             Quaternion q = Quaternion.Euler(0f, 0f, 0f);
             mendohl = Instantiate(mendohlPrefab, transform.position + new Vector3(2.5f, -.3f, 0), q);
             sceneController.handleMendohlSpawn();
             isMendohlSpawn = true;
         }
     }
     else if (!isMendohlDestroyed)
     {
         if (!DialogScheduler.HasDialog() && !isMendohlDestroyed)
         {
             destroyMendohlTimer += Time.deltaTime;
             if (destroyMendohlTimer > destroyMendohlTime)
             {
                 Destroy(mendohl);
                 isMendohlDestroyed = true;
             }
         }
     }
     else
     {
         destroyPortalTimer += Time.deltaTime;
         if (destroyPortalTimer > destroyPortalTime)
         {
             closePortal();
         }
     }
 }
 // Update is called once per frame
 void Update()
 {
     if (isWaitingDisplayFinalScreen && !DialogScheduler.HasDialog())
     {
         Time.timeScale = 1f;
         endScreen.SetActive(true);
         finalTimer += Time.deltaTime;
         if (finalTimer > finalTime)
         {
             SceneManager.LoadScene("Credits");
             print("trying to load credits");
         }
     }
 }
Beispiel #3
0
    // Update is called once per frame
    void Update()
    {
        if (Input.GetButtonDown("Skills") && !pauseMenu.activeInHierarchy && !DialogScheduler.HasDialog())
        {
            if (skillUi.activeInHierarchy)
            {
                skillUi.SetActive(false);
                Time.timeScale = 1;
            }
            else
            {
                skillUi.SetActive(true);
                Time.timeScale = 0;
                Cursor.SetCursor(null, Vector2.zero, CursorMode.Auto);
            }
        }
        else if (Input.GetButtonDown("Pause") && !skillUi.activeInHierarchy && !DialogScheduler.HasDialog())
        {
            if (pauseMenu.activeInHierarchy)
            {
                pauseMenu.SetActive(false);
                Time.timeScale = 1;
            }
            else
            {
                pauseMenu.SetActive(true);
                Time.timeScale = 0;
                Cursor.SetCursor(null, Vector2.zero, CursorMode.Auto);
            }
        }
        else if (Input.GetButtonDown("Die"))
        {
            deathMenu.SetActive(true);
            Cursor.SetCursor(null, Vector2.zero, CursorMode.Auto);
        }


        if (player.health <= 0)
        {
            deathMenu.SetActive(true);
            Cursor.SetCursor(null, Vector2.zero, CursorMode.Auto);
        }
    }