Beispiel #1
0
    } // end IEnumerator SpeedPower

    public IEnumerator Turret()
    {
        turretDown = Time.time + powerupTime * 2;
        if (!turret.activeSelf)
        {
            // power up
            sprite.sprite = turretActiveSprite;
            turret.SetActive(true);
            powerupUI.TurretActive();

            // wait for timer to run out
            yield return(new WaitWhile(() => turretDown > Time.time));

            // power down
            turret.transform.rotation = Quaternion.Euler(0.0f, turret.transform.rotation.eulerAngles.y, 0.0f);
            turret.SetActive(false);
            sprite.sprite = defaultSprite;
            powerupUI.TurretDeactive();

            if (turretCursor) // if the turret cursor is the current cursor
            {
                CursorManager.instance.SetDefaultCursor();
                //gameController.SetDefaultCursor(); // change back to the default cursor
                turretCursor = false;
            }
        }
    } // end IEnumerator Turret
    public void GameOver()
    {
        gameOver = true;

        // deactivate Crush game
        powerupUI.TurretDeactive();                // in case the turret overlay was active when the player got destroyed
        secondaryController.DeactivateMouse();
        secondaryController.countScore = false;    // stop counting matches after player death

        CursorManager.instance.SetDefaultCursor(); // in case the turret cursor was active when the player got destroyed

        SoundManager.instance.StopBackgroundMusic();

        if (!debug)
        {
            StartCoroutine(DatabaseManager.instance.UploadScore(score, wave));
        }

        Invoke("Restart", restartWait);
    }