-
Notifications
You must be signed in to change notification settings - Fork 81
Expand file tree
/
Copy pathNotification.cs
More file actions
54 lines (44 loc) · 1.17 KB
/
Notification.cs
File metadata and controls
54 lines (44 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
using System;
using System.Collections.Generic;
using UnityEngine;
namespace MyUnityEventDispatcher
{
public class Notification<T>
{
/// <summary>
///通知发送者
/// </summary>
public GameObject sender;
/// <summary>
/// 限制参数类型
/// </summary>
public T param;
/// <summary>
/// 构造函数
/// </summary>
/// <param name="sender">通知发送者</param>
/// <param name="param">通知内容</param>
public Notification(GameObject sender,T param)
{
this.sender = sender;
this.param = param;
}
/// <summary>
/// 构造函数
/// </summary>
/// <param name="param"></param>
public Notification(T param)
{
this.sender = null;
this.param = param;
}
/// <summary>
/// 实现ToString方法
/// </summary>
/// <returns></returns>
public override string ToString()
{
return string.Format("sender={0},param={1}", this.sender, this.param);
}
}
}