Exemple #1
0
    //public int numberOfFirePowerUps;

    public void SpawnPowerUp()
    {
        if (!isServer)
        {
            return;
        }

        powerUpController = FindObjectOfType <PowerUpController>();

        int randomIndex = Random.Range(0, powerUps.Length);

        if (Random.Range(0f, 1f) > 0.5f)
        {
            powerUpController.CmdSpawnPowerUp(transform.position, powerUps[randomIndex]);
        }
        //TODO: keep track of spawned powerups
    }
Exemple #2
0
 public void SpawnPowerUp()
 {
     if (!isServer)
     {
         return;
     }
     if (Random.Range(0f, 1f) < randNumber + additionalBonus)
     {
         powerUpController = FindObjectOfType <PowerUpController>();
         int randomIndex = Random.Range(0, powerUps.Length);
         if (maxNumberOfPowerUps[randomIndex] > 0)
         {
             randNumber += 0.02f;
             powerUpController.CmdSpawnPowerUp(transform.position, powerUps[randomIndex]);
             maxNumberOfPowerUps[randomIndex]--;
         }
     }
 }