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,57 @@
using UnityEngine;
using UnityEngine.Events;
public class ScoreController : CoreBehaviour
{
public enum ScoreType
{
DEFAULT_SCORE = 0
}
public class ScoreEvent : UnityEvent<int, Transform, ScoreType>
{
}
[HideInInspector]
public ScoreEvent onScore = new ScoreEvent();
public long Score { get; private set; }
public int multCurrency { get; private set; }
public void Setup()
{
Score = 0L;
}
public void InitScore(long score)
{
Score = score;
}
public void UpdateScore(long score, Transform obj, ScoreType type)
{
long delta = score - Score;
if (delta != 0L)
{
Score = score;
onScore.Invoke((int)delta, obj, type);
}
}
public void IncScore(long inc, Transform obj, ScoreType type)
{
Score += inc;
onScore.Invoke((int)inc, obj, type);
}
public void SetMultCurrency(int mult)
{
multCurrency = mult;
Score *= mult;
}
public void Reset()
{
Score = 0L;
}
}