void Spawn() { float randomX = Random.Range(-10, 10); float randomY = Random.Range(-3.67f, 3); Vector2 pos = new Vector2(randomX, randomY); if (!isSpawn) { CrystalOre crystalOreObj = ObjectPooler.Instance.GetObject(); crystalOreObj.transform.position = pos; crystalOreObj.gameObject.SetActive(true); isSpawn = true; StartCoroutine(Delay()); } }
public void ReturnToQueue(CrystalOre crystalOre) { queueCrystalOre.Enqueue(crystalOre); }
private CrystalOre AddObject() { CrystalOre crystalOre = Instantiate(prefab); return(crystalOre); }