Пример #1
0
    // 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);
        }
    }
Пример #2
0
 public void HitAndPowerup(string shooterId, Vector3 direction, int powerupIdx, string powerupId)
 {
     GeneralSunHit(shooterId);
     powerupCtrl.SpawnPowerup(direction, powerupIdx, powerupId);
 }