Example #1
0
 public override void Run()
 {
     if (PowerGrid.PowerIsAvailable(Miner.GetPowerDraw() * Time.deltaTime))
     {
         Miner.Mine();
     }
 }
 public override void Run()
 {
     counter += Time.deltaTime;
     if (counter >= rateOfFire && Turret.HasEnemyInRange() && PowerGrid.PowerIsAvailable(Turret.PowerDraw))
     {
         counter = 0;
         Turret.Shoot();
         roundsInCurrentClip--;
         if (roundsInCurrentClip <= 0)
         {
             stateMachine.TransitionTo <TurretReloadState>();
         }
     }
 }