void SpawnDrop() { GameObject _obj = ObjectPoolManager.Spawn(pfDrop); CreepDrop _creep = _obj.GetComponent <CreepDrop>(); _creep.Init(0); }
IEnumerator SpawnDrop() { float _posX = Random.Range(Pos.spawnLeft, Pos.spawnRight); lightTop.transform.position = new Vector3(_posX, lightTop.transform.position.y, lightTop.transform.position.z); lightTop.SetActive(true); yield return(new WaitForSeconds(1.0f)); lightTop.SetActive(false); GameObject _obj = ObjectPoolManager.Spawn(pfDrop); CreepDrop _creep = _obj.GetComponent <CreepDrop>(); _creep.Init(0); _obj.transform.position = new Vector3(_posX, Pos.top); }