From 3b036c6de871aa519a1f7fbfb52e09618945041f Mon Sep 17 00:00:00 2001 From: chai <215380520@qq.com> Date: Mon, 15 May 2023 09:28:11 +0800 Subject: *misc --- .../Tools/Notification/NotificationExtensions.cs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 WorldlineKeepers/Assets/Scripts/Tools/Notification/NotificationExtensions.cs (limited to 'WorldlineKeepers/Assets/Scripts/Tools/Notification/NotificationExtensions.cs') diff --git a/WorldlineKeepers/Assets/Scripts/Tools/Notification/NotificationExtensions.cs b/WorldlineKeepers/Assets/Scripts/Tools/Notification/NotificationExtensions.cs new file mode 100644 index 0000000..8313f7b --- /dev/null +++ b/WorldlineKeepers/Assets/Scripts/Tools/Notification/NotificationExtensions.cs @@ -0,0 +1,17 @@ +using System; + +namespace WK +{ + + public interface INotification + { + } + + public static class NotificationExtensions + { + public static void AddObserver(this INotification _this, string msg, NotificationCenter.NotificatonHandler handler) { NotificationCenter.Instance.AddObserver(_this, msg, handler); } + public static void RemoveObserver(this INotification _this, string msg, NotificationCenter.NotificatonHandler handler) { NotificationCenter.Instance.RemoveObserver(_this, msg, handler); } + public static void PostNotification(this INotification _this, string msg, params object[] p) { NotificationCenter.Instance.PostNotification(_this, msg, p); } + + } +} -- cgit v1.1-26-g67d0