void GenerarEnAltura(Vector2 altura, int n) { for (int i = 0; i < n; i++) { ObjetosFondo aux = Instantiate(objeto, new Vector2(Random.Range(0f, limiteDerecho - limiteIzquierdo), Random.Range(0f, GeneradorPlataformas.instance.distanciaEntrePlataformas)) + altura, Quaternion.identity); todosLosElementosFondo.Add(aux); aux.AsignarGenerador(this); } }
public void EliminarObjeto(ObjetosFondo objeto) { todosLosElementosFondo.Remove(objeto); }