using System; using System.Collections.Generic; using UnityEngine; namespace MyUnityEventDispatcher { public class Notification { /// ///通知发送者 /// public GameObject sender; /// /// 限制参数类型 /// public T param; /// /// 构造函数 /// /// 通知发送者 /// 通知内容 public Notification(GameObject sender,T param) { this.sender = sender; this.param = param; } /// /// 构造函数 /// /// public Notification(T param) { this.sender = null; this.param = param; } /// /// 实现ToString方法 /// /// public override string ToString() { return string.Format("sender={0},param={1}", this.sender, this.param); } } }