Beispiel #1
0
 protected void BaseBuildingInitialization()
 {
     damageSystem.SetMaxHp(MaxHp);
     if (isStartWithFullHp)
     {
         damageSystem.Heal(MaxHp);
     }
     CreationOutput = this.transform.position;
 }
Beispiel #2
0
 public override void UpdateOrder()
 {
     if (unitToOrder != null)
     {
         if (buildingDamageSystem == null)
         {
             StopOrder();
         }
         if (unitToOrder.isNearToDestination(BuildingToBuild.ObjectCollider.bounds.center, NearestDistance))
         {
             buildingDamageSystem.Heal(buildingDamageSystem.MaxHp / TimeUntilFullConstruction * Time.deltaTime);
             unitToOrder.agent.SetDestination(unitToOrder.transform.position);
         }
         if (buildingDamageSystem.Hp >= buildingDamageSystem.MaxHp)
         {
             StopOrder();
         }
     }
 }