Skip to content

OnWaterCollect

Usage

  • Return a non-null value to override default behavior

Example Autogenerated

csharp
private void OnWaterCollect( WaterCatcher instance )
{
    Puts( "OnWaterCollect works!" );
}
csharp
private void OnWaterCollect( WaterPump instance, ItemDefinition itemDefinition )
{
    Puts( "OnWaterCollect works!" );
}

Location

  • WaterCatcher::CollectWater()
  • WaterPump::CreateWater()
csharp
//---
{
	if (this.IsFull())
	{
		return;
	}
	if (Interface.CallHook("OnWaterCollect", this) != null)
	{
		return;
	}
	float num = this.collectionRates.baseRate;
	num += Climate.GetFog(base.transform.position) * this.collectionRates.fogRate;
//---
csharp
//---
		return;
	}
	ItemDefinition itemDefinition = WaterResource.SV_GetAtPoint(this.WaterResourceLocation.position);
	if (itemDefinition != null)
	{
		if (Interface.CallHook("OnWaterCollect", this, itemDefinition) != null)
		{
			return;
		}
		base.inventory.AddItem(itemDefinition, this.AmountPerPump, 0uL, ItemContainer.LimitStack.Existing);
		base.UpdateOnFlag();
//---

Released under the MIT License.