Ultimate Progression Framework System
v1.0.0

Public configuration and state

MemberTypePurpose
idintUnique lookup identifier
currencyNamestringDisplay, persistence and economy-matching name
typeCurrencyTypeInt or Float behavior
defaultValuefloatFirst-run and reset value
currentValuefloatCurrent serialized runtime balance

Balance methods

SignatureReturnsBehavior
GetValue()floatReturns the current typed balance
SetValue(float newValue)voidReplaces, saves and raises change-direction events
ModifyValue(float amount)voidAdds a positive or negative delta, then saves and raises events
HasEnough(float amount)boolChecks whether the current balance meets the amount

Persistence methods

SignatureBehavior
SaveData()Writes the current typed value to PlayerPrefs
LoadData()Loads the typed key or uses Default Value
ResetToDefault()Restores Default Value, saves and raises reset/change events

Events

EventPayload meaning
OnValueChangedNew current balance
OnValueIncreasedPositive amount gained
OnValueDecreasedPositive magnitude deducted
OnValueResetBalance after reset
OnValueLoadedBalance after load

Safe purchase guard

csharp
const float cost = 125f;

if (gold.HasEnough(cost))
{
    gold.ModifyValue(-cost);
}
else
{
    Debug.Log("Not enough Gold");
}