DurabilityGlobalSettings
A class in Root.Township, the global namespace.
Global settings for item durability feedback: break effects, damage popups and how hit effectiveness turns into durability loss.
- Listed in Global namespace: C to D
- Inherits or implements
GlobalSettings<DurabilityGlobalSettings> - Derived types
DurabilityGlobalSettings,DurabilityGlobalSettings.Create - Nested types
Create - Attributes
GlobalSettings
Constructors
| Member | What it is |
|---|---|
DurabilityGlobalSettings() | Use ScriptableObject.CreateInstance instead of new; Unity loads the saved ones from assets. |
Fields
6 private and internal fields
| Member | What it is |
|---|---|
private AnimationCurve breakItemHapticCurve | Haptic curve played when an item breaks. |
private SoundEffectSet defaultStateChangeSound | Sound played on a durability state change when none is set elsewhere. |
private AnimationCurve effectivenessToDurabilityDamage | Curve from hit effectiveness to durability damage, used by EvaluateEfectivenessDamage. |
private Gradient popupColorByDurability | Gradient that colours the popup by durability, used by GetPopupColor. |
private PooledObjectDefinition popUpDefinition | Pooled text popup shown for durability, used by GetPopup. |
private PooledObjectDefinition stateChangeEffectDefinition | Pooled DurabilityStateChangeEffect spawned by GetEffect. |
Properties
| Member | What it is |
|---|---|
AnimationCurve BreakItemHapticCurve { get; } | Haptic curve played on the holding hand when an item breaks. |
SoundEffectSet DefaultStateChangeSound { get; } | Sound played when an item's durability state changes. |
Methods
| Member | What it is |
|---|---|
float EvaluateEfectivenessDamage(float effectiveness) | Durability loss for a hit's effectiveness. ImpactTool multiplies it by the hit's durability multiplier. |
PooledObject GetEffect(Renderer renderer) | Spawns the state change effect shaped to a renderer's mesh. |
TextPopup GetPopup(Transform parent) | Gets a pooled text popup under a parent. |
Color GetPopupColor(float durability) | Popup colour for a durability value. |