protected void BaseBuildingInitialization() { damageSystem.SetMaxHp(MaxHp); if (isStartWithFullHp) { damageSystem.Heal(MaxHp); } CreationOutput = this.transform.position; }
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(); } } }