public GameObject SpawnBulletFromPool(bool TipoBala, Vector3 posicion, Quaternion rotacion) { GameObject ObjetoaSpawnear; string bala; if (TipoBala) { bala = "BalasMalas"; ObjetoaSpawnear = poolDiccionario[bala].Dequeue(); } else { bala = "BalasBuenas"; ObjetoaSpawnear = poolDiccionario[bala].Dequeue(); } ObjetoaSpawnear.SetActive(true); ObjetoaSpawnear.transform.position = posicion; ObjetoaSpawnear.transform.rotation = rotacion; Bullet mibull = ObjetoaSpawnear.GetComponent <Bullet>(); mibull.initializeBullet(); poolDiccionario[bala].Enqueue(ObjetoaSpawnear); return(ObjetoaSpawnear); }
public GameObject SpawnParticle(bool enemiga, Vector3 posicion, Quaternion rotacion) { GameObject ObjetoaSpawnear; string particula; if (enemiga) { particula = "PartiBads"; ObjetoaSpawnear = poolDiccionario[particula].Dequeue(); } else { particula = "PartiCools"; ObjetoaSpawnear = poolDiccionario[particula].Dequeue(); } ObjetoaSpawnear.SetActive(true); ObjetoaSpawnear.transform.position = posicion; ObjetoaSpawnear.transform.rotation = rotacion; ObjetoaSpawnear.GetComponent <ParticleSystem>().Play(); poolDiccionario[particula].Enqueue(ObjetoaSpawnear); return(ObjetoaSpawnear); }