void InitTest()
{
var bytes = Resources.Load <TextAsset>("unittestdll.dll").bytes;
var bytespdb = Resources.Load <TextAsset>("unittestdll.pdb").bytes;
//var bytes = Resources.Load<TextAsset>("unittestdll2.dll").bytes;
//var bytesmdb = Resources.Load<TextAsset>("unittestdll2.dll.mdb").bytes;//现在支持mdb了
System.IO.MemoryStream ms = new System.IO.MemoryStream(bytes);
System.IO.MemoryStream mspdb = new System.IO.MemoryStream(bytespdb);
//System.IO.MemoryStream msmdb = new System.IO.MemoryStream(bytesmdb);
//Log(" L# Ver:" + env.version);
try
{
env.LoadModule(ms, mspdb, new Mono.Cecil.Pdb.PdbReaderProvider());
//env.LoadModule(ms, msmdb, new Mono.Cecil.Mdb.MdbReaderProvider());
}
catch (Exception err)
{
Log_Error(err.ToString());
Log_Error("模块未加载完成,请检查错误");
}
ResetTest();
Log(" Got Test:" + tests.Count);
env.RegType(new TypeForGameObject(env));
//for aot
env.GetType(typeof(Dictionary <int, string>));
env.GetType(typeof(Dictionary <int, object>));
env.GetType(typeof(Dictionary <int, CLRSharp.CLRSharp_Instance>));
env.GetType(typeof(Dictionary <int, Action>));
env.GetType(typeof(Dictionary <int, Action <MyClass2> >));
env.GetType(typeof(Dictionary <Int16, Action>));
env.GetType(typeof(LinkedList <int>));
env.GetType(typeof(int[, ]));
env.GetType(typeof(List <CLScriptExt.Student>));
env.GetType(typeof(List <Vector3>));
env.GetType(typeof(List <int>[]));
env.GetType(typeof(List <List <int> >));
env.GetType(typeof(List <List <List <int> > >));
env.GetType(typeof(Vector3[]));
env.GetType(typeof(System.Collections.Generic.IEnumerable <int>));
TestDele.instance.AddDeleT3 <int, string>(null);
CLScriptExt.Student s = new CLScriptExt.Student();
s.ToString2 <int>(2);//call once will help.
CLScriptExt.P2.TestS2 <int, int>();
//for aot dele
CLRSharp.Delegate_Binder.RegBind(typeof(Action <int>), new CLRSharp.Delegate_BindTool <int>());
CLRSharp.Delegate_Binder.RegBind(typeof(Action <MyClass2>), new CLRSharp.Delegate_BindTool <MyClass2>());
CLRSharp.Delegate_Binder.RegBind(typeof(Action <int, int>), new CLRSharp.Delegate_BindTool <int, int>());
CLRSharp.Delegate_Binder.RegBind(typeof(Action <int, int, int>), new CLRSharp.Delegate_BindTool <int, int, int>());
CLRSharp.Delegate_Binder.RegBind(typeof(Func <int, int, int>), new CLRSharp.Delegate_BindTool_Ret <int, int, int>());
CLRSharp.Delegate_Binder.RegBind(typeof(Action <int, string>), new CLRSharp.Delegate_BindTool <int, string>());
CLRSharp.Delegate_Binder.RegBind(typeof(Action <string>), new CLRSharp.Delegate_BindTool <string>());
CLRSharp.Delegate_Binder.RegBind(typeof(Action <bool>), new CLRSharp.Delegate_BindTool <bool>());
}