You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
CrowdControl/Assets/3rd/Plugins/UltEvents/Event Holders/UltEventHolder.cs

42 lines
1.3 KiB
C#

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