Esempio n. 1
0
    private void SpawnCoffeeMaker(CoffeeMakerType coffeeMakerType)
    {
        GameObject coffeeMakerPrefab = _coffeeMakerPrefabs[coffeeMakerType];
        Vector3    spawnPoint        = RandomSpawnPoint();
        var        coffeeMaker       = Instantiate(coffeeMakerPrefab, spawnPoint, Quaternion.identity) as GameObject;

        coffeeMaker.transform.SetParent(transform);
        coffeeMaker.GetComponent <CoffeeMaker>().Died += () => _coffeeMakersAlive--;
    }
Esempio n. 2
0
    private IEnumerator SpawnCoffeeMakers(CoffeeMakerType type, int amount, float timeBetweenSpawns)
    {
        for (int i = 0; i < amount; i++)
        {
            yield return(new WaitForSeconds(timeBetweenSpawns));

            SpawnCoffeeMaker(type);
        }
    }