private void SpawnRandomPowerUp(Transform pos) { float v = Random.value; Collectable newCollectable; if (v > 0.5) { newCollectable = Collectable.CreateMultishot(); } else if (v > 0.2f) { newCollectable = Collectable.CreateBerserk(); } else { newCollectable = Collectable.CreateLaser(); } newCollectable.gameObject.transform.position = pos.position; }