You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

30 lines
674 B

using System;
namespace UnityEditor.PackageManager.UI
{
[Serializable]
internal class OperationSignal<T> where T: IBaseOperation
{
public event Action<T> OnOperation = delegate { };
public T Operation { get; set; }
public void SetOperation(T operation)
{
Operation = operation;
OnOperation(operation);
}
public void WhenOperation(Action<T> callback)
{
if (Operation != null)
callback(Operation);
OnOperation += callback;
}
internal void ResetEvents()
{
OnOperation = delegate { };
}
}
}