// Start is called before the first frame update void Start() { obj = this.transform; controller = GameObject.FindWithTag("powerupcontroller"); power = controller.GetComponent <PowerupController>(); if (Random.value < /*0.01*/ 0.1)//Chance of powerup spawning { power.SpawnPowerup(power.powerups[Random.Range(0, 3)], obj.position); } }
public void HitAndPowerup(string shooterId, Vector3 direction, int powerupIdx, string powerupId) { GeneralSunHit(shooterId); powerupCtrl.SpawnPowerup(direction, powerupIdx, powerupId); }