using System; using SLSFramework.General; using UnityEngine; using UnityEngine.Events; namespace SLSFramework.General { public class EventUnit : IPrioritized { private readonly UnityAction action; public int Priority { get; set; } public EventUnit(UnityAction action, int priority = 0) { this.action = action; this.Priority = priority; } public void Invoke() { action.Invoke(); } } public class EventUnit : IPrioritized { private readonly UnityAction action; public int Priority { get; set; } public EventUnit(UnityAction action, int priority = 0) { this.action = action; this.Priority = priority; } public void Invoke(T arg) { action.Invoke(arg); } } public class EventUnit : IPrioritized { private readonly UnityAction action; public int Priority { get; set; } public EventUnit(UnityAction action, int priority = 0) { this.action = action; this.Priority = priority; } public void Invoke(T1 arg1, T2 arg2) { action.Invoke(arg1, arg2); } } public class EventUnit : IPrioritized { private readonly UnityAction action; public int Priority { get; set; } public EventUnit(UnityAction action, int priority = 0) { this.action = action; this.Priority = priority; } public void Invoke(T1 arg1, T2 arg2, T3 arg3) { action.Invoke(arg1, arg2, arg3); } } public class PrioritizedFunc : IPrioritized { private readonly Func func; public int Priority { get; set; } public PrioritizedFunc(Func func, int priority = 0) { this.func = func; this.Priority = priority; } public TR Invoke(T1 arg1, T2 arg2, T3 arg3) { return func.Invoke(arg1, arg2, arg3); } } }