using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.Events; public class GameEvent : MonoBehaviour { public UnityEvent OnTriggered; [SerializeField] private bool _triggerOnStart; private void Start() { if (_triggerOnStart) { TriggerEvent(); } } public void TriggerEvent() { OnTriggered?.Invoke(); } }