// UltEvents // Copyright 2020 Kybernetik // using UnityEngine; namespace UltEvents { /// /// A component which encapsulates a single . /// [AddComponentMenu(UltEventUtils.ComponentMenuPrefix + "Ult Event Holder")] [HelpURL(UltEventUtils.APIDocumentationURL + "/UltEventHolder")] public class UltEventHolder : MonoBehaviour { /************************************************************************************************************************/ [SerializeField] private UltEvent _Event; /// The encapsulated event. public UltEvent Event { get { if (_Event == null) _Event = new UltEvent(); return _Event; } set { _Event = value; } } /************************************************************************************************************************/ /// Calls Event.Invoke(). public virtual void Invoke() { if (_Event != null) _Event.Invoke(); } /************************************************************************************************************************/ } }