forked from hiram3512/HiSocket
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMsgRegistBase.cs
31 lines (29 loc) · 885 Bytes
/
MsgRegistBase.cs
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
/***************************************************************
* Description:
*
* Documents: https://github.com/hiramtan/HiSocket_unity
* Author: [email protected]
***************************************************************/
using System;
using System.Reflection;
namespace HiSocket.Message
{
public abstract class MsgRegistBase
{
public static void Init()
{
var ass = Assembly.GetExecutingAssembly();
var types = ass.GetTypes();
var baseType = typeof(MsgRegistBase);
for (int i = 0; i < types.Length; i++)
{
if (types[i].IsSubclassOf(baseType))
{
var ins = Activator.CreateInstance(types[i]) as MsgRegistBase;
ins.Regist();
}
}
}
public abstract void Regist();
}
}