Idle Game System

Core systems for idle/incremental games — passive income generation, offline earnings, upgrade progression, number formatting, and responsive mobile UI.

3 scripts intermediate Core system Idle/incremental/clicker game developers

Download idle-game-system.zip 3 scripts and a README · 14 KB of C# · MIT

What is inside

What it does

  • 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

Setup, in order

  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

If something does not work

Offline earnings are not paid out
IdleIncomeGenerator saves the quit time in PlayerPrefs from OnApplicationPause and OnApplicationQuit, and pays the difference on the next start. Stopping Play mode in the Editor may skip the pause event; test offline earnings in a build.
The UI layout breaks on tablets
Put MobileResponsiveScaler on the root Canvas that has the CanvasScaler. It adjusts the scaler's width-height match from the screen shape, so anchor UI elements to corners and edges rather than placing them by absolute position.

Preview

An excerpt of the kit's main types, and the Inspector fields they expose.

InspectorExcerpt

Fields from the kit's preview excerpt; the full kit has more.

Base Income Per Second 1
Upgrade Cost Multiplier 1.15
Excerpt
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;
    }
}