Files
HauntedBloodlines/Assets/Scripts/Pickups/KeyPickUpAction.cs
2025-05-29 22:31:40 +03:00

26 lines
626 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class KeyPickUpAction : MonoBehaviour
{
[HideInInspector] KeyPickup _KeyPickup;
[SerializeField] private EventTrigger eventAfterPlayerObtainedKey;
private bool ActionPerformed;
private void Awake()
{
_KeyPickup = GetComponent<KeyPickup>();
}
private void Update()
{
if (_KeyPickup.hasKey && !ActionPerformed)
{
//GameManagerEarly.GetInstance().DoAction = true;
eventAfterPlayerObtainedKey.Invoke();
ActionPerformed = true;
}
}
}