intermediate
Idle Game System
Core systems for idle/incremental games — passive income generation, offline earnings, upgrade progression, number formatting, and responsive mobile UI.
Features
Passive income generation per second
Offline earnings calculation on app resume
Exponential cost upgrade system
Number formatting (K, M, B, T)
Prestige/reset with permanent multipliers
Responsive UI scaling for all screen sizes
Included Scripts
/idle-game-system/
Setup Guide
1
Import all scripts into your Unity project
2
Add IdleIncomeGenerator to a persistent manager object
3
Configure income sources, base rates, and upgrade costs in the inspector
4
Attach ScoreManager to track currency and high scores
5
Add MobileResponsiveScaler to your root Canvas for adaptive UI layout
Code Preview
C#
// IdleIncomeGenerator.cs - Passive income with offline earnings
public class IdleIncomeGenerator : MonoBehaviour
{
[SerializeField] private double baseIncomePerSecond = 1.0;
[SerializeField] private double upgradeCostMultiplier = 1.15;
public double CurrentIncome { get; private set; }
public int UpgradeLevel { get; private set; }
public void PurchaseUpgrade()
{
double cost = GetUpgradeCost();
// Deduct currency, increase income, scale cost
UpgradeLevel++;
CurrentIncome = baseIncomePerSecond * UpgradeLevel;
}
public double CalculateOfflineEarnings()
{
// Calculate earnings since last session
double elapsed = (DateTime.Now - lastSaveTime).TotalSeconds;
return CurrentIncome * elapsed * offlineMultiplier;
}
}Available Individually
These scripts are also available as standalone downloads: