示例#1
0
    IEnumerator InstanciaPelota(int numPelotas, Pelota pelotaPrefab, Vector2 targetPos, Vector3 posOrigen)
    {
        for (int i = 0; i < numPelotas; i++)
        {
            yield return(new WaitForSeconds(0.05f));

            Pelota  nuevaPelota = Instantiate(pelotaPrefab);
            Vector2 dir         = (targetPos).normalized;

            nuevaPelota.LaunchBall(posOrigen, dir);

            yield return(null);
        }

        CanvasManager.instance.setReturnSpawnActive(true);

        yield break;    //Stop coroutine
    }