Skip to main content

DiggingImpactorSettings

A class in Root.Township, the global namespace.

Settings for a digging tool's DiggingImpactor: which hits dig and how deep, how hard it is to pull out, and durability cost, all scaled by hit efficiency.

Constructors​

MemberWhat it is
DiggingImpactorSettings()Use ScriptableObject.CreateInstance instead of new; Unity loads the saved ones from assets.

Fields​

11 private and internal fields
MemberWhat it is
private float baseDiggingDamageBase dig damage. Defaults to 1.
private ImpactChannel[] diggingChannelsImpact channels that count as digging.
private AnimationCurve efficiencyToDepthCurve from dig efficiency to how deep the tool goes.
private AnimationCurve efficiencyToDurabilityDamageCurve from dig efficiency to tool durability lost per dig.
private AnimationCurve efficiencyToPullCurve from dig efficiency to how far the tool must be pulled to come out.
private AnimationCurve efficiencyToRadiusCurve from dig efficiency to dig radius.
private AnimationCurve efficiencyToTorqueCurve from dig efficiency to how much twist digs the tool out.
private float minEffectivenessLowest dig effectiveness at zero efficiency. Defaults to 0.2.
private PositionEvent onDigEffectEffect event fired at a position when digging.
private PositionEvent onEmbbedEffectEffect event fired at a position when the tool embeds.
private LayerMask targetLayersLayers the tool can dig into.

Properties​

MemberWhat it is
float BaseDiggingDamage { get; }Base digging damage value.
ImpactChannel[] DiggingChannels { get; }Impact channels checked when the tool hits the ground.
float MinEffectiveness { get; }Hits below this effectiveness do not dig. Efficiency is measured from here up to 1.
int TargetLayersValue { get; }Layer mask of colliders that can be dug. Hits on rigidbodies are ignored.

Methods​

MemberWhat it is
void DigEffect(Vector3 position)Plays the dig effect at a position.
void EmbbedEffect(Vector3 position)Plays the effect for the tool sticking into the ground.
float GetDepth(float efficiency)How far the tool sinks into the ground for an efficiency.
float GetDurabilityDamage(float efficiency)Durability the tool loses for an efficiency.
float GetPull(float efficiency)How much pull is needed to get the tool out, for an efficiency.
float GetRadius(float efficiency)Radius of the dig for an efficiency.
float GetTorque(float efficiency)How much twist is needed to get the tool out, for an efficiency.

Used in​

Members of other types that take, return or hold a DiggingImpactorSettings: