started building out level

Signed-off-by: sdqhome\caleb <caleb@sdqhome.co.uk>
This commit is contained in:
2026-08-05 08:18:15 +01:00
parent f53c8256df
commit 7b8d500f75
6372 changed files with 6314829 additions and 20587 deletions

View File

@@ -0,0 +1,38 @@
using UnityEngine;
namespace Quests
{
[RequireComponent(typeof(Collider))]
public class LocationObjectiveTrigger : MonoBehaviour
{
[Tooltip("The Target ID of the ReachLocation objective.")]
[SerializeField] private string locationID;
[Tooltip("Only trigger when the collider tagged with this tag enters. Default: 'Player'")]
[SerializeField] private string playerTag = "Player";
[Tooltip("If true, this trigger object disables itself after firing once.")]
[SerializeField] private bool triggerOnce = true;
private bool hasTriggered = false;
private void OnTriggerEnter(Collider other)
{
if (hasTriggered && triggerOnce) return;
if (other.CompareTag(playerTag))
{
if (QuestManager.Instance != null)
{
QuestManager.Instance.ReportLocationReached(locationID);
hasTriggered = true;
if (triggerOnce)
{
gameObject.SetActive(false);
}
}
}
}
}
}