Repaired hole minigame

This commit is contained in:
2026-04-26 12:55:21 +02:00
parent 74fa735322
commit abbe4842fe
26 changed files with 4471 additions and 282 deletions

View File

@@ -1,7 +1,9 @@
using System;
using UnityEngine;
using UnityEngine.Events;
using GeoSus.Client;
public class LevelManager : MonoBehaviour
public class LevelManager : MonoBehaviour, ITask
{
public static LevelManager Instance;
@@ -14,11 +16,15 @@ public class LevelManager : MonoBehaviour
private int scoredCount = 0;
void Awake()
{
if (Instance == null) Instance = this;
else Destroy(gameObject);
}
public string TaskID { get; set; }
public TaskType TaskType { get; set; }
public string TaskName { get; set; }
public Position TaskLocation { get; set; }
public bool IsCompleted { get; private set; } = false;
protected Action<ITask> OnCompleted;
public void RegisterItem()
{
@@ -38,4 +44,25 @@ public class LevelManager : MonoBehaviour
public int GetScoredCount() => scoredCount;
public int GetTotalCount() => itemsToScore;
public void Initialize(Action<ITask> onCompleted)
{
OnCompleted = onCompleted;
IsCompleted = false;
ResetCounter();
}
public void ExitTask(Action<ITask> onExit)
{
onExit?.Invoke(this);
}
public void Complete()
{
if (IsCompleted) return;
IsCompleted = true;
OnCompleted?.Invoke(this);
}
}