Hra kabely

This commit is contained in:
2026-03-28 19:28:59 +01:00
parent f7926a218e
commit 1de91b0d57
80 changed files with 22549 additions and 653 deletions

View File

@@ -0,0 +1,41 @@
using UnityEngine;
using UnityEngine.Events;
public class LevelManager : MonoBehaviour
{
public static LevelManager Instance;
[Header("Nastavení levelu")]
[Tooltip("Kolik itemů musí hráč trefit pro splnění levelu")]
public int itemsToScore = 3;
[Header("Event vyvolá se po trefení všech itemů")]
public UnityEvent OnAllItemsScored;
private int scoredCount = 0;
void Awake()
{
if (Instance == null) Instance = this;
else Destroy(gameObject);
}
public void RegisterItem()
{
scoredCount++;
Debug.Log($"Trefeno: {scoredCount} / {itemsToScore}");
if (scoredCount >= itemsToScore)
{
OnAllItemsScored?.Invoke();
}
}
public void ResetCounter()
{
scoredCount = 0;
}
public int GetScoredCount() => scoredCount;
public int GetTotalCount() => itemsToScore;
}