void SpawnPassengers() { passengerChance = Random.Range(0, 100); if (passengerChance <= 40) { passCount++; tempHolder = Instantiate(passenger, spawnPoints[3], Quaternion.identity); pickUpList.Add(tempHolder); PD = tempHolder.GetComponent <PickUpsData>(); PD.expireTimer = objDur; } }
void SpawnItems() { for (int i = 0; i < powerUpChance.Length; i++) { powerUpRoll = Random.Range(0, 100); if (powerUpRoll <= powerUpChance[i]) { spawnID = Random.Range(0, spawnPoints.Length - 1); tempHolder = Instantiate(pickUpPrefabs[i], spawnPoints[spawnID], Quaternion.identity); pickUpList.Add(tempHolder); PD = tempHolder.GetComponent <PickUpsData>(); PD.expireTimer = objDur; } } }