Exemplo n.º 1
0
    void Update()
    {
        if (foodPile == null)
        {
            timer -= Time.deltaTime;
            if (timer <= 0)
            {
                timer = 1;
                var food = spawner.SpawnFood();
                food.GetComponent <EatFood>().gameManager = this;
                foodPile = food;
            }
        }

        scoreText.text = "Score: " + score;
    }