Exemplo n.º 1
0
 void MoveToRandomDirection()
 {
     rb2D.drag       = minDrag;
     currentMoveTime = rng.Range(moveTimeMin, moveTimeMax);
     rb2D.velocity   = rng.Choose(possibleVectorDirections) * rng.Range(speedMin, speedMax);
     moving          = true;
 }
Exemplo n.º 2
0
 public void PlaySound(SoundType soundType)
 {
     if (isOn)
     {
         foreach (GameSound gameSound in sounds)
         {
             if (gameSound.soundType == soundType)
             {
                 rng.Choose(gameSound.sounds).Play();
             }
         }
     }
 }