26 lines
626 B
C#
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;
|
|
}
|
|
}
|
|
}
|