Skip to content

OnDecayHeal

Usage

  • Return a non-null value to override default behavior

Example Autogenerated

csharp
private object OnDecayHeal( DecayEntity instance )
{
    Puts( "OnDecayHeal works!" );
    return null;
}

Location

  • DecayEntity::OnDecay(Decay decay, float decayDeltaTime)
csharp
//---
				upkeepTimer -= buildingPrivilege.PurchaseUpkeepTime(this, Mathf.Max(upkeepTimer, 600f));
			}
		}
		if (upkeepTimer < 1f)
		{
			if (base.healthFraction < 1f && GetEntityHealScale() > 0f && base.SecondsSinceAttacked > 600f && Interface.CallHook("OnDecayHeal", this) == null)
			{
				float num2 = decayDeltaTime / GetEntityDecayDuration() * GetEntityHealScale();
				Heal(MaxHealth() * num2);
			}
			return;
//---

Released under the MIT License.