// Update is called once per frame
    void Update()
    {
        if (speed != 0)
        {
            if (camera.GetComponent <GameController>().emJogo)
            {
                x = transform.position.x;

                x += -pLayerController.getDifficultyLevel() * Time.deltaTime;
                transform.position = new Vector3(x, transform.position.y, transform.position.z);

                if (x <= -22)
                {
                    //Debug.Log("Quantidade de prefabs no  array: "+ SpawnController.prefabsEmCena.Count);


                    Destroy(transform.gameObject);

                    if (SpawnController.indicesRemovidos.Count >= 1)
                    {
                        SpawnController.indicesRemovidos.RemoveAt(SpawnController.indicesRemovidos.Count - 1);
                        //Debug.Log("Removeu um indice: " + SpawnController.indicesRemovidos.Count);
                    }

                    if (SpawnController.prefabsEmCena.Count == 2)
                    {
                        SpawnController.prefabsEmCena.RemoveAt(SpawnController.prefabsEmCena.Count - 1);
                    }
                }
            }
        }
    }
    // Update is called once per frame
    void Update()
    {
        if (!GameController.emPausa)
        {
            innateDelay += Time.deltaTime / delay;
            if (innateDelay >= 1)
            {
                int chosenPowerUp = Mathf.RoundToInt(Random.Range(0, 4f));
                if ((chosenPowerUp == ESPINGARDA && pLayerController.temEspingarda) || (chosenPowerUp == PEIXEIRA && pLayerController.temPeixeira))
                {
                    chosenPowerUp = GARRAFA;
                }


                Vector3 pj = GameObject.Find("Colisor").transform.position;

                float x     = pj.x + 13f;
                float y     = pj.y + 5f;
                float speed = pLayerController.getDifficultyLevel();

                addPowerUp(x, y, chosenPowerUp, speed);

                innateDelay = 0;
            }
        }
    }