提交 c7500f18 编写于 作者: T tanghai

优化获取程序集Type集合

上级 1f1e547a
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using ETModel;
......@@ -39,7 +40,7 @@ namespace ETHotfix
self.ActorMessageHandlers.Clear();
self.ActorTypeHandlers.Clear();
Type[] types = DllHelper.GetMonoTypes();
List<Type> types = Game.EventSystem.GetTypes();
foreach (Type type in types)
{
......
......@@ -33,7 +33,7 @@ namespace ETHotfix
AppType appType = Game.Scene.GetComponent<StartConfigComponent>().StartConfig.AppType;
Type[] types = DllHelper.GetMonoTypes();
List<Type> types = Game.EventSystem.GetTypes();
foreach (Type type in types)
{
......
......@@ -8,16 +8,20 @@ namespace ETHotfix
{
public override void Awake(NetOuterComponent self)
{
self.Awake();
self.Awake(NetworkProtocol.KCP);
self.MessagePacker = new ProtobufPacker();
self.MessageDispatcher = new OuterMessageDispatcher();
}
}
[ObjectSystem]
public class NetOuterComponentAwake1System : AwakeSystem<NetOuterComponent, IPEndPoint>
{
public override void Awake(NetOuterComponent self, IPEndPoint a)
public override void Awake(NetOuterComponent self, IPEndPoint ipEndPoint)
{
self.Awake(a);
self.Awake(NetworkProtocol.KCP, ipEndPoint);
self.MessagePacker = new ProtobufPacker();
self.MessageDispatcher = new OuterMessageDispatcher();
}
}
......@@ -29,26 +33,4 @@ namespace ETHotfix
self.Update();
}
}
public static class NetOuterComponentEx
{
public static void Awake(this NetOuterComponent self)
{
self.Awake(NetworkProtocol.KCP);
self.MessagePacker = new ProtobufPacker();
self.MessageDispatcher = new OuterMessageDispatcher();
}
public static void Awake(this NetOuterComponent self, IPEndPoint ipEndPoint)
{
self.Awake(NetworkProtocol.KCP, ipEndPoint);
self.MessagePacker = new ProtobufPacker();
self.MessageDispatcher = new OuterMessageDispatcher();
}
public static void Update(this NetOuterComponent self)
{
self.Update();
}
}
}
\ No newline at end of file
......@@ -18,15 +18,5 @@ namespace ETModel
Assembly assembly = Assembly.Load(dllBytes, pdbBytes);
return assembly;
}
public static Type[] GetMonoTypes()
{
List<Type> types = new List<Type>();
foreach (Assembly assembly in Game.EventSystem.GetAll())
{
types.AddRange(assembly.GetTypes());
}
return types.ToArray();
}
}
}
......@@ -67,7 +67,7 @@ namespace ETModel
this.getHandlers = new Dictionary<string, MethodInfo>();
this.postHandlers = new Dictionary<string, MethodInfo>();
Type[] types = DllHelper.GetMonoTypes();
List<Type> types = Game.EventSystem.GetTypes();
foreach (Type type in types)
{
......
......@@ -29,7 +29,7 @@ namespace ETEditor
public static Dictionary<string, NodeMeta> ExportToDict()
{
Dictionary<string, NodeMeta> name2NodeProtoDict = new Dictionary<string, NodeMeta>();
Type[] types = DllHelper.GetMonoTypes();
List<Type> types = Game.EventSystem.GetTypes();
foreach (Type type in types)
{
NodeMeta proto = GetNodeTypeProtoFromType(type);
......
......@@ -17,6 +17,7 @@ namespace ETModel
private readonly Dictionary<long, Component> allComponents = new Dictionary<long, Component>();
private readonly Dictionary<DLLType, Assembly> assemblies = new Dictionary<DLLType, Assembly>();
private readonly List<Type> types = new List<Type>();
private readonly Dictionary<string, List<IEvent>> allEvents = new Dictionary<string, List<IEvent>>();
......@@ -48,6 +49,11 @@ namespace ETModel
public void Add(DLLType dllType, Assembly assembly)
{
this.assemblies[dllType] = assembly;
this.types.Clear();
foreach (Assembly value in this.assemblies.Values)
{
this.types.AddRange(value.GetTypes());
}
this.awakeSystems.Clear();
this.lateUpdateSystems.Clear();
......@@ -56,7 +62,6 @@ namespace ETModel
this.loadSystems.Clear();
this.changeSystems.Clear();
Type[] types = DllHelper.GetMonoTypes();
foreach (Type type in types)
{
object[] attrs = type.GetCustomAttributes(typeof(ObjectSystemAttribute), false);
......@@ -145,10 +150,10 @@ namespace ETModel
{
return this.assemblies[dllType];
}
public Assembly[] GetAll()
public List<Type> GetTypes()
{
return this.assemblies.Values.ToArray();
return this.types;
}
public void Add(Component component)
......
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
......@@ -33,7 +34,7 @@ namespace ETModel
this.start.Run();
}
public Type[] GetHotfixTypes()
public List<Type> GetHotfixTypes()
{
#if ILRuntime
if (this.appDomain == null)
......@@ -41,13 +42,13 @@ namespace ETModel
return new Type[0];
}
return this.appDomain.LoadedTypes.Values.Select(x => x.ReflectionType).ToArray();
return this.appDomain.LoadedTypes.Values.Select(x => x.ReflectionType);
#else
if (this.assembly == null)
{
return new Type[0];
return new List<Type>();
}
return this.assembly.GetTypes();
return this.assembly.GetTypes().ToList();
#endif
}
......
using System;
using System.Collections.Generic;
using System.IO;
using System.Reflection;
namespace ETModel
{
public static class DllHelper
{
public static Type[] GetMonoTypes()
{
List<Type> types = new List<Type>();
foreach (Assembly assembly in Game.EventSystem.GetAll())
{
types.AddRange(assembly.GetTypes());
}
return types.ToArray();
}
public static Type[] GetAllTypes()
{
List<Type> types = new List<Type>();
foreach (Assembly assembly in Game.EventSystem.GetAll())
{
types.AddRange(assembly.GetTypes());
}
types.AddRange(Game.Hotfix.GetHotfixTypes());
return types.ToArray();
}
}
}
\ No newline at end of file
......@@ -42,7 +42,7 @@ namespace ETModel
this.treeCache = new Dictionary<GameObject, BehaviorTree>();
Type[] types = DllHelper.GetMonoTypes();
List<Type> types = Game.EventSystem.GetTypes();
foreach (Type type in types)
{
object[] attrs = type.GetCustomAttributes(typeof(NodeAttribute), false);
......
......@@ -36,7 +36,7 @@ namespace ETModel
public void Load()
{
this.allConfig.Clear();
Type[] types = DllHelper.GetMonoTypes();
List<Type> types = Game.EventSystem.GetTypes();
foreach (Type type in types)
{
......
......@@ -37,7 +37,7 @@ namespace ETModel
{
this.handlers.Clear();
Type[] types = DllHelper.GetMonoTypes();
List<Type> types = Game.EventSystem.GetTypes();
foreach (Type type in types)
{
......
......@@ -161,8 +161,7 @@ namespace ETModel
e.RemoteEndPoint = null;
this.isConnected = true;
this.StartRecv();
this.StartSend();
this.Start();
}
private void OnDisconnectComplete(object o)
......
using System;
using System.Collections.Generic;
namespace ETModel
{
......@@ -17,7 +18,7 @@ namespace ETModel
public void Awake()
{
Type[] types = DllHelper.GetMonoTypes();
List<Type> types = Game.EventSystem.GetTypes();
foreach (Type type in types)
{
object[] attrs = type.GetCustomAttributes(typeof(MessageAttribute), false);
......
......@@ -37,7 +37,7 @@ namespace ETModel
{
this.allWatchers = new Dictionary<NumericType, List<INumericWatcher>>();
Type[] types = DllHelper.GetMonoTypes();
List<Type> types = Game.EventSystem.GetTypes();
foreach (Type type in types)
{
object[] attrs = type.GetCustomAttributes(typeof(NumericWatcherAttribute), false);
......
......@@ -66,7 +66,7 @@ namespace ETModel
{
this.UiTypes.Clear();
Type[] types = DllHelper.GetMonoTypes();
List<Type> types = Game.EventSystem.GetTypes();
foreach (Type type in types)
{
......
......@@ -51,6 +51,8 @@ namespace ILRuntime.Runtime.Generated
ETModel_MoveComponent_Binding.Register(app);
System_Collections_Generic_Dictionary_2_Type_ILTypeInstance_Binding.Register(app);
ETModel_Hotfix_Binding.Register(app);
System_Collections_Generic_List_1_Type_Binding.Register(app);
System_Collections_Generic_List_1_Type_Binding_Enumerator_Binding.Register(app);
System_Type_Binding.Register(app);
System_Reflection_MemberInfo_Binding.Register(app);
System_Activator_Binding.Register(app);
......@@ -74,10 +76,10 @@ namespace ILRuntime.Runtime.Generated
System_Collections_Generic_Dictionary_2_Type_Queue_1_ILTypeInstance_Binding.Register(app);
System_Collections_Generic_Queue_1_ILTypeInstance_Binding.Register(app);
ETModel_SessionCallbackComponent_Binding.Register(app);
System_Collections_Generic_Dictionary_2_Int32_Action_1_ILTypeInstance_Binding.Register(app);
ETModel_Component_Binding.Register(app);
ETModel_Packet_Binding.Register(app);
ETModel_ProtobufHelper_Binding.Register(app);
System_Collections_Generic_Dictionary_2_Int32_Action_1_ILTypeInstance_Binding.Register(app);
ETModel_MessageInfo_Binding.Register(app);
System_Threading_Tasks_TaskCompletionSource_1_ILTypeInstance_Binding.Register(app);
System_Threading_CancellationToken_Binding.Register(app);
......
......@@ -52,6 +52,11 @@ namespace ILRuntime.Runtime.Generated
var result_of_this_method = instance_of_this_method.GetHotfixTypes();
object obj_result_of_this_method = result_of_this_method;
if(obj_result_of_this_method is CrossBindingAdaptorType)
{
return ILIntepreter.PushObject(__ret, __mStack, ((CrossBindingAdaptorType)obj_result_of_this_method).ILInstance);
}
return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
}
......
......@@ -31,8 +31,11 @@ namespace ILRuntime.Runtime.Generated
method = type.GetMethod("get_Bytes", flag, null, args, null);
app.RegisterCLRMethodRedirection(method, get_Bytes_2);
args = new Type[]{};
method = type.GetMethod("get_Offset", flag, null, args, null);
app.RegisterCLRMethodRedirection(method, get_Offset_3);
args = new Type[]{};
method = type.GetMethod("get_Length", flag, null, args, null);
app.RegisterCLRMethodRedirection(method, get_Length_3);
app.RegisterCLRMethodRedirection(method, get_Length_4);
}
......@@ -87,7 +90,24 @@ namespace ILRuntime.Runtime.Generated
return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
}
static StackObject* get_Length_3(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
static StackObject* get_Offset_3(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
{
ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
StackObject* ptr_of_this_method;
StackObject* __ret = ILIntepreter.Minus(__esp, 1);
ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
ETModel.Packet instance_of_this_method = (ETModel.Packet)typeof(ETModel.Packet).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
__intp.Free(ptr_of_this_method);
var result_of_this_method = instance_of_this_method.Offset;
__ret->ObjectType = ObjectTypes.Integer;
__ret->Value = result_of_this_method;
return __ret + 1;
}
static StackObject* get_Length_4(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
{
ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
StackObject* ptr_of_this_method;
......
......@@ -21,15 +21,21 @@ namespace ILRuntime.Runtime.Generated
MethodBase method;
Type[] args;
Type type = typeof(System.Collections.Generic.Dictionary<System.Int32, System.Action<ILRuntime.Runtime.Intepreter.ILTypeInstance>>);
args = new Type[]{};
method = type.GetMethod("get_Values", flag, null, args, null);
app.RegisterCLRMethodRedirection(method, get_Values_0);
args = new Type[]{};
method = type.GetMethod("Clear", flag, null, args, null);
app.RegisterCLRMethodRedirection(method, Clear_1);
args = new Type[]{typeof(System.Int32), typeof(System.Action<ILRuntime.Runtime.Intepreter.ILTypeInstance>).MakeByRefType()};
method = type.GetMethod("TryGetValue", flag, null, args, null);
app.RegisterCLRMethodRedirection(method, TryGetValue_0);
app.RegisterCLRMethodRedirection(method, TryGetValue_2);
args = new Type[]{typeof(System.Int32)};
method = type.GetMethod("Remove", flag, null, args, null);
app.RegisterCLRMethodRedirection(method, Remove_1);
app.RegisterCLRMethodRedirection(method, Remove_3);
args = new Type[]{typeof(System.Int32), typeof(System.Action<ILRuntime.Runtime.Intepreter.ILTypeInstance>)};
method = type.GetMethod("set_Item", flag, null, args, null);
app.RegisterCLRMethodRedirection(method, set_Item_2);
app.RegisterCLRMethodRedirection(method, set_Item_4);
args = new Type[]{};
method = type.GetConstructor(flag, null, args, null);
......@@ -38,7 +44,37 @@ namespace ILRuntime.Runtime.Generated
}
static StackObject* TryGetValue_0(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
static StackObject* get_Values_0(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
{
ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
StackObject* ptr_of_this_method;
StackObject* __ret = ILIntepreter.Minus(__esp, 1);
ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
System.Collections.Generic.Dictionary<System.Int32, System.Action<ILRuntime.Runtime.Intepreter.ILTypeInstance>> instance_of_this_method = (System.Collections.Generic.Dictionary<System.Int32, System.Action<ILRuntime.Runtime.Intepreter.ILTypeInstance>>)typeof(System.Collections.Generic.Dictionary<System.Int32, System.Action<ILRuntime.Runtime.Intepreter.ILTypeInstance>>).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
__intp.Free(ptr_of_this_method);
var result_of_this_method = instance_of_this_method.Values;
return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
}
static StackObject* Clear_1(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
{
ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
StackObject* ptr_of_this_method;
StackObject* __ret = ILIntepreter.Minus(__esp, 1);
ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
System.Collections.Generic.Dictionary<System.Int32, System.Action<ILRuntime.Runtime.Intepreter.ILTypeInstance>> instance_of_this_method = (System.Collections.Generic.Dictionary<System.Int32, System.Action<ILRuntime.Runtime.Intepreter.ILTypeInstance>>)typeof(System.Collections.Generic.Dictionary<System.Int32, System.Action<ILRuntime.Runtime.Intepreter.ILTypeInstance>>).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
__intp.Free(ptr_of_this_method);
instance_of_this_method.Clear();
return __ret;
}
static StackObject* TryGetValue_2(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
{
ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
StackObject* ptr_of_this_method;
......@@ -116,7 +152,7 @@ namespace ILRuntime.Runtime.Generated
return __ret + 1;
}
static StackObject* Remove_1(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
static StackObject* Remove_3(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
{
ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
StackObject* ptr_of_this_method;
......@@ -136,7 +172,7 @@ namespace ILRuntime.Runtime.Generated
return __ret + 1;
}
static StackObject* set_Item_2(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
static StackObject* set_Item_4(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
{
ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
StackObject* ptr_of_this_method;
......
using System;
using System.Collections.Generic;
using System.Reflection;
using System.Runtime.InteropServices;
using ILRuntime.CLR.TypeSystem;
using ILRuntime.CLR.Method;
using ILRuntime.Runtime.Enviorment;
using ILRuntime.Runtime.Intepreter;
using ILRuntime.Runtime.Stack;
using ILRuntime.Reflection;
using ILRuntime.CLR.Utils;
namespace ILRuntime.Runtime.Generated
{
unsafe class System_Collections_Generic_List_1_Type_Binding
{
public static void Register(ILRuntime.Runtime.Enviorment.AppDomain app)
{
BindingFlags flag = BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static | BindingFlags.DeclaredOnly;
MethodBase method;
Type[] args;
Type type = typeof(System.Collections.Generic.List<System.Type>);
args = new Type[]{};
method = type.GetMethod("GetEnumerator", flag, null, args, null);
app.RegisterCLRMethodRedirection(method, GetEnumerator_0);
}
static StackObject* GetEnumerator_0(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
{
ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
StackObject* ptr_of_this_method;
StackObject* __ret = ILIntepreter.Minus(__esp, 1);
ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
System.Collections.Generic.List<System.Type> instance_of_this_method = (System.Collections.Generic.List<System.Type>)typeof(System.Collections.Generic.List<System.Type>).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
__intp.Free(ptr_of_this_method);
var result_of_this_method = instance_of_this_method.GetEnumerator();
return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
}
}
}
fileFormatVersion: 2
guid: 20fbd2b0398f14a4d89abd01726d5d25
timeCreated: 1498118075
licenseType: Free
guid: 54e08e729e2f1f5429804a6ba5786f21
timeCreated: 1529041539
licenseType: Pro
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
......
using System;
using System.Collections.Generic;
using System.Reflection;
using System.Runtime.InteropServices;
using ILRuntime.CLR.TypeSystem;
using ILRuntime.CLR.Method;
using ILRuntime.Runtime.Enviorment;
using ILRuntime.Runtime.Intepreter;
using ILRuntime.Runtime.Stack;
using ILRuntime.Reflection;
using ILRuntime.CLR.Utils;
namespace ILRuntime.Runtime.Generated
{
unsafe class System_Collections_Generic_List_1_Type_Binding_Enumerator_Binding
{
public static void Register(ILRuntime.Runtime.Enviorment.AppDomain app)
{
BindingFlags flag = BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static | BindingFlags.DeclaredOnly;
MethodBase method;
Type[] args;
Type type = typeof(System.Collections.Generic.List<System.Type>.Enumerator);
args = new Type[]{};
method = type.GetMethod("get_Current", flag, null, args, null);
app.RegisterCLRMethodRedirection(method, get_Current_0);
args = new Type[]{};
method = type.GetMethod("MoveNext", flag, null, args, null);
app.RegisterCLRMethodRedirection(method, MoveNext_1);
app.RegisterCLRCreateDefaultInstance(type, () => new System.Collections.Generic.List<System.Type>.Enumerator());
}
static void WriteBackInstance(ILRuntime.Runtime.Enviorment.AppDomain __domain, StackObject* ptr_of_this_method, IList<object> __mStack, ref System.Collections.Generic.List<System.Type>.Enumerator instance_of_this_method)
{
ptr_of_this_method = ILIntepreter.GetObjectAndResolveReference(ptr_of_this_method);
switch(ptr_of_this_method->ObjectType)
{
case ObjectTypes.Object:
{
__mStack[ptr_of_this_method->Value] = instance_of_this_method;
}
break;
case ObjectTypes.FieldReference:
{
var ___obj = __mStack[ptr_of_this_method->Value];
if(___obj is ILTypeInstance)
{
((ILTypeInstance)___obj)[ptr_of_this_method->ValueLow] = instance_of_this_method;
}
else
{
var t = __domain.GetType(___obj.GetType()) as CLRType;
t.SetFieldValue(ptr_of_this_method->ValueLow, ref ___obj, instance_of_this_method);
}
}
break;
case ObjectTypes.StaticFieldReference:
{
var t = __domain.GetType(ptr_of_this_method->Value);
if(t is ILType)
{
((ILType)t).StaticInstance[ptr_of_this_method->ValueLow] = instance_of_this_method;
}
else
{
((CLRType)t).SetStaticFieldValue(ptr_of_this_method->ValueLow, instance_of_this_method);
}
}
break;
case ObjectTypes.ArrayReference:
{
var instance_of_arrayReference = __mStack[ptr_of_this_method->Value] as System.Collections.Generic.List<System.Type>.Enumerator[];
instance_of_arrayReference[ptr_of_this_method->ValueLow] = instance_of_this_method;
}
break;
}
}
static StackObject* get_Current_0(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
{
ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
StackObject* ptr_of_this_method;
StackObject* __ret = ILIntepreter.Minus(__esp, 1);
ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
ptr_of_this_method = ILIntepreter.GetObjectAndResolveReference(ptr_of_this_method);
System.Collections.Generic.List<System.Type>.Enumerator instance_of_this_method = (System.Collections.Generic.List<System.Type>.Enumerator)typeof(System.Collections.Generic.List<System.Type>.Enumerator).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
var result_of_this_method = instance_of_this_method.Current;
WriteBackInstance(__domain, ptr_of_this_method, __mStack, ref instance_of_this_method);
object obj_result_of_this_method = result_of_this_method;
if(obj_result_of_this_method is CrossBindingAdaptorType)
{
return ILIntepreter.PushObject(__ret, __mStack, ((CrossBindingAdaptorType)obj_result_of_this_method).ILInstance);
}
return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
}
static StackObject* MoveNext_1(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
{
ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
StackObject* ptr_of_this_method;
StackObject* __ret = ILIntepreter.Minus(__esp, 1);
ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
ptr_of_this_method = ILIntepreter.GetObjectAndResolveReference(ptr_of_this_method);
System.Collections.Generic.List<System.Type>.Enumerator instance_of_this_method = (System.Collections.Generic.List<System.Type>.Enumerator)typeof(System.Collections.Generic.List<System.Type>.Enumerator).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
var result_of_this_method = instance_of_this_method.MoveNext();
WriteBackInstance(__domain, ptr_of_this_method, __mStack, ref instance_of_this_method);
__ret->ObjectType = ObjectTypes.Integer;
__ret->Value = result_of_this_method ? 1 : 0;
return __ret + 1;
}
}
}
fileFormatVersion: 2
guid: 09a9570fea5e288459dbfb4e0185f4de
timeCreated: 1529041539
licenseType: Pro
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
......@@ -48,7 +48,7 @@ namespace ILRuntime.Runtime.Generated
}
}
}
args = new Type[]{typeof(System.String)};
args = new Type[]{typeof(System.Action<ILRuntime.Runtime.Intepreter.ILTypeInstance>)};
if (genericMethods.TryGetValue("ToArray", out lst))
{
foreach(var m in lst)
......@@ -62,6 +62,20 @@ namespace ILRuntime.Runtime.Generated
}
}
}
args = new Type[]{typeof(System.String)};
if (genericMethods.TryGetValue("ToArray", out lst))
{
foreach(var m in lst)
{
if(m.GetParameters().Length == 1)
{
method = m.MakeGenericMethod(args);
app.RegisterCLRMethodRedirection(method, ToArray_2);
break;
}
}
}
args = new Type[]{typeof(ILRuntime.Runtime.Intepreter.ILTypeInstance)};
if (genericMethods.TryGetValue("First", out lst))
{
......@@ -70,7 +84,7 @@ namespace ILRuntime.Runtime.Generated
if(m.GetParameters().Length == 1)
{
method = m.MakeGenericMethod(args);
app.RegisterCLRMethodRedirection(method, First_2);
app.RegisterCLRMethodRedirection(method, First_3);
break;
}
......@@ -103,6 +117,22 @@ namespace ILRuntime.Runtime.Generated
StackObject* ptr_of_this_method;
StackObject* __ret = ILIntepreter.Minus(__esp, 1);
ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
System.Collections.Generic.IEnumerable<System.Action<ILRuntime.Runtime.Intepreter.ILTypeInstance>> @source = (System.Collections.Generic.IEnumerable<System.Action<ILRuntime.Runtime.Intepreter.ILTypeInstance>>)typeof(System.Collections.Generic.IEnumerable<System.Action<ILRuntime.Runtime.Intepreter.ILTypeInstance>>).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
__intp.Free(ptr_of_this_method);
var result_of_this_method = System.Linq.Enumerable.ToArray<System.Action<ILRuntime.Runtime.Intepreter.ILTypeInstance>>(@source);
return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
}
static StackObject* ToArray_2(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
{
ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
StackObject* ptr_of_this_method;
StackObject* __ret = ILIntepreter.Minus(__esp, 1);
ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
System.Collections.Generic.IEnumerable<System.String> @source = (System.Collections.Generic.IEnumerable<System.String>)typeof(System.Collections.Generic.IEnumerable<System.String>).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
__intp.Free(ptr_of_this_method);
......@@ -113,7 +143,7 @@ namespace ILRuntime.Runtime.Generated
return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
}
static StackObject* First_2(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
static StackObject* First_3(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
{
ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
StackObject* ptr_of_this_method;
......
......@@ -37,7 +37,7 @@ namespace ETHotfix
public EventSystem()
{
Type[] types = ETModel.Game.Hotfix.GetHotfixTypes();
List<Type> types = ETModel.Game.Hotfix.GetHotfixTypes();
foreach (Type type in types)
{
object[] attrs = type.GetCustomAttributes(typeof(ObjectSystemAttribute), false);
......
......@@ -37,7 +37,7 @@ namespace ETHotfix
public void Load()
{
this.allConfig.Clear();
Type[] types = ETModel.Game.Hotfix.GetHotfixTypes();
List<Type> types = ETModel.Game.Hotfix.GetHotfixTypes();
foreach (Type type in types)
{
......
......@@ -41,7 +41,7 @@ namespace ETHotfix
ETModel.MessageDispatherComponent messageDispatherComponent = ETModel.Game.Scene.GetComponent<ETModel.MessageDispatherComponent>();
ETModel.OpcodeTypeComponent opcodeTypeComponent = ETModel.Game.Scene.GetComponent<ETModel.OpcodeTypeComponent>();
Type[] types = ETModel.Game.Hotfix.GetHotfixTypes();
List<Type> types = ETModel.Game.Hotfix.GetHotfixTypes();
foreach (Type type in types)
{
......
using System;
using System.Collections.Generic;
using ETModel;
using ProtoBuf;
......@@ -19,7 +20,7 @@ namespace ETHotfix
public void Awake()
{
Type[] types = ETModel.Game.Hotfix.GetHotfixTypes();
List<Type> types = ETModel.Game.Hotfix.GetHotfixTypes();
foreach (Type type in types)
{
object[] attrs = type.GetCustomAttributes(typeof(MessageAttribute), false);
......
......@@ -67,7 +67,7 @@ namespace ETHotfix
{
UiTypes.Clear();
Type[] types = ETModel.Game.Hotfix.GetHotfixTypes();
List<Type> types = ETModel.Game.Hotfix.GetHotfixTypes();
foreach (Type type in types)
{
......
......@@ -12,16 +12,13 @@
<ProjectTypeGuids>{E097FAD1-6243-4DAD-9C02-E9B9EFC3FFC1};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<TargetFrameworkIdentifier>.NETFramework</TargetFrameworkIdentifier>
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
<TargetFrameworkProfile>
</TargetFrameworkProfile>
<CompilerResponseFile>
</CompilerResponseFile>
<TargetFrameworkProfile></TargetFrameworkProfile>
<CompilerResponseFile></CompilerResponseFile>
<UnityProjectGenerator>VSTU</UnityProjectGenerator>
<UnityProjectType>Game:1</UnityProjectType>
<UnityBuildTarget>StandaloneWindows:5</UnityBuildTarget>
<UnityVersion>2017.4.3f1</UnityVersion>
<RootNamespace>
</RootNamespace>
<RootNamespace></RootNamespace>
<LangVersion>6</LangVersion>
</PropertyGroup>
<PropertyGroup>
......@@ -355,7 +352,6 @@
<Compile Include="Assets\Scripts\G2C_TestHandler.cs" />
<Compile Include="Assets\Scripts\Helper\ActionHelper.cs" />
<Compile Include="Assets\Scripts\Helper\BundleHelper.cs" />
<Compile Include="Assets\Scripts\Helper\DllHelper.cs" />
<Compile Include="Assets\Scripts\Helper\GameObjectHelper.cs" />
<Compile Include="Assets\Scripts\Helper\ILHelper.cs" />
<Compile Include="Assets\Scripts\Helper\PathHelper.cs" />
......@@ -562,6 +558,8 @@
<Compile Include="Assets\ThirdParty\ILRuntime\Generated\System_Collections_Generic_List_1_ILTypeInstance_Binding_Enume_t.cs" />
<Compile Include="Assets\ThirdParty\ILRuntime\Generated\System_Collections_Generic_List_1_Object_Binding.cs" />
<Compile Include="Assets\ThirdParty\ILRuntime\Generated\System_Collections_Generic_List_1_String_Binding.cs" />
<Compile Include="Assets\ThirdParty\ILRuntime\Generated\System_Collections_Generic_List_1_Type_Binding.cs" />
<Compile Include="Assets\ThirdParty\ILRuntime\Generated\System_Collections_Generic_List_1_Type_Binding_Enumerator_Bind_t.cs" />
<Compile Include="Assets\ThirdParty\ILRuntime\Generated\System_Collections_Generic_List_1_UnitInfo_Binding.cs" />
<Compile Include="Assets\ThirdParty\ILRuntime\Generated\System_Collections_Generic_List_1_UnitInfo_Binding_Enumerator__t.cs" />
<Compile Include="Assets\ThirdParty\ILRuntime\Generated\System_Collections_Generic_Queue_1_ILTypeInstance_Binding.cs" />
......@@ -936,4 +934,4 @@
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="GenerateTargetFrameworkMonikerAttribute" />
</Project>
\ No newline at end of file
</Project>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册