rabidus-test/Assets/GameEvent.cs

25 lines
426 B
C#
Raw Normal View History

2023-10-11 15:44:05 +03:00
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();
}
}