Creating New Currencies
The CurrencyData ScriptableObject defines all the in-game currencies (coins, gems, energy, etc.) used in the SlingshotSquad Template.
Step 1 โ Create a Currency Scriptable
In the Project window, right-click and select:
Create > SlingshotPuzzle > Currency DataRename the new asset to match the currency type (e.g.,
Gold,Diamonds,Energy).
Step 2 โ Assign in GameInstance
Open the MainMenu scene.
Select the GameInstance object.
In the Currency List, add your new CurrencyData asset.
Save the scene.
Your new currency is now integrated into the economy system.
Editable Variables (CurrencyData)
Each CurrencyData has public fields you can configure in the Unity Inspector:
๐น Coin Information
coinName โ Display name of the currency.
coinID โ Unique identifier (used internally for saving/logic).
icon โ Sprite shown in the UI (wallet, shop, HUD).
initialAmount โ Amount the player starts with by default.
๐น Maximum Amount Settings
useMaxAmount โ Enable if this currency should have a cap.
maxAmount โ The maximum allowed value (only visible if
useMaxAmountis enabled).canExceedMaxValue โ Allows the value to go over the cap in specific cases (e.g., rewards, gifts).
๐น Rechargeable Settings
isRechargeableCurrency โ If true, the currency refills automatically (e.g., โEnergyโ).
rechargeableTimeScale โ Time unit for recharge (Seconds, Minutes, Hours).
rechargeableTime โ How long it takes for one recharge cycle.
rechargeAmount โ Amount refilled per cycle.
RechargeWhileOffline โ If true, recharge continues even when the game is closed.
โ
Example Uses
Gold Coins โ No max limit, collected from levels.
Gems โ Premium currency with optional max limit.
Energy โ Rechargeable currency, regenerates every few minutes.
Last updated