public void SpawnGirls() { micrograme = GetComponent <Microgame> (); num = Random.Range(min, max + 1); for (int i = 0; i < num; i++) { float x = Random.Range(minX, maxX); float y = Random.Range(minY, maxY); Vector2 pos = new Vector2(x, y); GameObject PartyGirl = Instantiate(girl, pos, Quaternion.identity); micrograme.OnInstantiateObject(PartyGirl); } int boyNum = Random.Range(boyMin, boyMax + 1); for (int i = 0; i < boyNum; i++) { float x = Random.Range(minX, maxX); float y = Random.Range(minY, maxY); Vector2 pos = new Vector2(x, y); GameObject DistractingBoi = Instantiate(boy, pos, Quaternion.identity); micrograme.OnInstantiateObject(DistractingBoi); } gameStarted = true; }
public void OnHit(DanceArrow arr) { Destroy(arr.gameObject); var go = Instantiate(_SpawnOnHit, arr.transform.position, Quaternion.identity); _Microgame.OnInstantiateObject(go.gameObject); }
void spawnNewPPB() { GameObject newPPB = Instantiate(PPBPrefab); microgame.OnInstantiateObject(newPPB); newPPB.GetComponent <PingPongBall>().beerPongManager = this; float spawnX = 0.9f * Random.Range(-camWidth / 2, camWidth / 2); newPPB.transform.position = new Vector3(spawnX, 0f); }