public void Spawn()
    {
        Vector3    aleatoire      = new Vector3(rando.Next(-10, 10), 0, 0);
        GameObject recycledEnnemy = ennemyPool.GetObject();

        recycledEnnemy.transform.position = transform.position + aleatoire;
        recycledEnnemy.transform.rotation = transform.rotation;
        recycledEnnemy.SetActive(true);
    }
Example #2
0
    public void Shoot()
    {
        if (elapsedTime > cooldown)
        {
            var recycledProjectile = projectileObjectPool.GetObject();
            ResetProjectile(recycledProjectile);

            elapsedTime = 0;
        }
    }