예제 #1
0
 public IEnumerator RepairBuilding(BuildingBase building)
 {
     while (building.life < building.lifeMax)
     {
         building.AddLife(buildSpeed);
         yield return(new WaitForFixedUpdate());
     }
 }
예제 #2
0
 public IEnumerator MeleeAttack(BuildingBase building)
 {
     while (building.life > 0)
     {
         if (attackCooldown >= attackCooldownMax)
         {
             building.AddLife(-damage);
             attackCooldown = 0;
         }
         else
         {
             attackCooldown += attackSpeed;
         }
         yield return(new WaitForFixedUpdate());
     }
 }