Exemple #1
0
    IEnumerator FoodSpawner()
    {
        yield return(new WaitForSeconds(timeBetweenSpawn));

        int prefabIndex = Random.Range(0, foodOnRoadPrefab.Length);

        Instantiate(foodOnRoadPrefab[prefabIndex], m_obstacleManger.GetRandomLaneSpawn() + offset, Quaternion.identity);
        StartCoroutine(FoodSpawner());
    }