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(); } private void Update() { if (_KeyPickup.hasKey && !ActionPerformed) { //GameManagerEarly.GetInstance().DoAction = true; eventAfterPlayerObtainedKey.Invoke(); ActionPerformed = true; } } }