add project files

This commit is contained in:
Boris Nikolaev
2026-08-14 01:58:31 +03:00
parent 9134cad79b
commit 5f1e94b653
4399 changed files with 12286903 additions and 0 deletions
@@ -0,0 +1,55 @@
using System;
using UnityEngine;
public class CoreCurrenciesController
{
public CoreCurrenciesDef Def { get; private set; }
public int CurrenciesWon { get; private set; }
public bool CurrenciesMultiplied { get; private set; }
public event Action<int, Transform> onWinCurrencies;
public event Action onMultiplyCurrencies;
public void Setup(CoreCurrenciesDef def)
{
Def = def;
}
public void Reset()
{
CurrenciesWon = 0;
CurrenciesMultiplied = false;
}
public void WinCurrency(int count, Transform from)
{
CurrenciesWon += count;
if (this.onWinCurrencies != null)
{
this.onWinCurrencies(count, from);
}
}
public void MultiplyCurrencies(Transform from)
{
if (CurrenciesMultiplied)
{
return;
}
int multiplier = Def.currencyMultiplier;
int before = CurrenciesWon;
CurrenciesWon = multiplier * before;
if (this.onWinCurrencies != null)
{
this.onWinCurrencies((multiplier - 1) * before, from);
}
CurrenciesMultiplied = true;
if (this.onMultiplyCurrencies != null)
{
this.onMultiplyCurrencies();
}
}
}