forked from kbengine/kbengine_unity3d_plugins
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathScriptModule.cs
56 lines (45 loc) · 1.67 KB
/
ScriptModule.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
namespace KBEngine
{
using UnityEngine;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Reflection;
/*
一个entitydef中定义的脚本模块的描述类
包含了某个entity定义的属性与方法以及该entity脚本模块的名称与模块ID
*/
public class ScriptModule
{
public string name;
public bool usePropertyDescrAlias;
public bool useMethodDescrAlias;
public Dictionary<string, Property> propertys = new Dictionary<string, Property>();
public Dictionary<UInt16, Property> idpropertys = new Dictionary<UInt16, Property>();
public Dictionary<string, Method> methods = new Dictionary<string, Method>();
public Dictionary<string, Method> base_methods = new Dictionary<string, Method>();
public Dictionary<string, Method> cell_methods = new Dictionary<string, Method>();
public Dictionary<UInt16, Method> idmethods = new Dictionary<UInt16, Method>();
public Dictionary<UInt16, Method> idbase_methods = new Dictionary<UInt16, Method>();
public Dictionary<UInt16, Method> idcell_methods = new Dictionary<UInt16, Method>();
public Type script = null;
public ScriptModule(string modulename)
{
name = modulename;
foreach (System.Reflection.Assembly ass in AppDomain.CurrentDomain.GetAssemblies())
{
script = ass.GetType ("KBEngine." + modulename);
if(script == null)
{
script = ass.GetType (modulename);
}
if(script != null)
break;
}
usePropertyDescrAlias = false;
useMethodDescrAlias = false;
if(script == null)
Dbg.ERROR_MSG("can't load(KBEngine." + modulename + ")!");
}
}
}