Skip to main content

DurabilitySettings

A class in Root.Township, the global namespace.

Scriptable object with an item's durability rules: either a chance to break or a starting durability, and how damage converts to wear.

Constructors​

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

Fields​

3 private and internal fields
MemberWhat it is
private float damageConversionBacking field for DamageConversion.
private float durabilityBacking field for Durability.
private bool isChanceBasedDurabilityBacking field for IsChanceBasedDurability.

Properties​

MemberWhat it is
float DamageConversion { get; }Multiplier from damage taken to durability lost. Defaults to 1.
float Durability { get; }Chance to break when IsChanceBasedDurability is on, otherwise the starting durability. Defaults to 0.5.
bool IsChanceBasedDurability { get; }When true, the item breaks by chance instead of wearing down.
override string SubFolder { get; }Puts these assets under "Items/" in the popup asset picker.

Used in​

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