public override void OnAttach(Context context) { base.OnAttach(context); if (context is OnActionListener) { actionListener = (OnActionListener)context; } else { throw new RuntimeException(context.ToString() + " must implement OnActionListener"); } }
public override void OnDetach() { base.OnDetach(); actionListener = null; }
/// <summary> /// /// </summary> /// <param name="arg1"></param> /// <param name="arg2"></param> public T Send() { return(OnActionListener != null?OnActionListener.Invoke() : default(T)); }
/// <summary> /// Invoke the Event and Calls all the methods that are subscribed to specific Event. /// </summary> public void Send() { OnActionListener?.Invoke(); }
/// <summary> /// </summary> /// <param name="arg1"></param> /// <param name="arg2"></param> public T Invoke() { return(OnActionListener != null?OnActionListener.Invoke() : default);