Exemplo n.º 1
0
        static public void InitHotModule()
        {
            appdomain = new AppDomain();
            try
            {
                DllStream = CopyStream(ResLoad.GetStream("Data/DyncDll.dll"));
                if (DllStream != null)
                {
#if USE_PDB
                    SymbolStream = CopyStream(ResLoad.GetStream("Data/DyncDll.pdb"));
                    appdomain.LoadAssembly(DllStream, SymbolStream, new ILRuntime.Mono.Cecil.Pdb.PdbReaderProvider());
#elif USE_MDB
                    SymbolStream = CopyStream(ResLoad.GetStream("Data/DyncDll.mdb"));
                    appdomain.LoadAssembly(DllStream, SymbolStream, new ILRuntime.Mono.Cecil.Mdb.MdbReaderProvider());
#else
                    appdomain.LoadAssembly(DllStream);
#endif
                }
            }
            catch (System.Exception ex)
            {
                wxb.L.LogException(ex);
            }

            RegDelegate(appdomain);
            IL.Help.Init();
        }
Exemplo n.º 2
0
        static public void InitHotModule(TextAsset dll)
        {
            appdomain = new AppDomain();
            appdomain.RegisterCrossBindingAdaptor(new CoroutineAdapter());

#if UNITY_EDITOR
            System.Type clrType = System.Type.GetType("ILRuntime.Runtime.Generated.CLRBindings");
            if (clrType != null)
            {
                clrType.GetMethod("Initialize").Invoke(null, new object[] { appdomain });
            }
#else
            ILRuntime.Runtime.Generated.CLRBindings.Initialize(appdomain);
#endif
            ILRuntime.Runtime.Generated.UnityEngine_Debug_Binding.Register(appdomain);

#if UNITY_EDITOR
            ResLoad.Set(new EditorResLoad());
#endif

            try
            {
#if TEST_MODEL
                var dlldata = ResLoad.GetStream(Paths.HOT_DLL_PATH);
                DllStream = CopyStream(dlldata);
#elif BUILD_MODEL
                DllStream = CopyStream(new MemoryStream(dll.bytes));
#endif
                if (DllStream != null)
                {
#if USE_PDB
                    var pdbdata = ResLoad.GetStream(Paths.HOT_PDB_PATH);
                    SymbolStream = CopyStream(pdbdata);
                    appdomain.LoadAssembly(DllStream, SymbolStream, new ILRuntime.Mono.Cecil.Pdb.PdbReaderProvider());
                    //启动调试服务器
                    appdomain.DebugService.StartDebugService(56000);
#elif USE_MDB
                    SymbolStream = CopyStream(ResLoad.GetStream("Data/DyncDll.mdb"));
                    appdomain.LoadAssembly(DllStream, SymbolStream, new ILRuntime.Mono.Cecil.Mdb.MdbReaderProvider());
#else
                    appdomain.LoadAssembly(DllStream);
#endif
                }
            }
            catch (System.Exception ex)
            {
                wxb.L.LogException(ex);
            }

            RegDelegate(appdomain);
            IL.Help.Init();
        }
Exemplo n.º 3
0
        static public void InitHotModule()
        {
            appdomain = new AppDomain();
            appdomain.RegisterCrossBindingAdaptor(new CoroutineAdapter());

#if UNITY_EDITOR
            System.Type clrType = System.Type.GetType("ILRuntime.Runtime.Generated.CLRBindings");
            if (clrType != null)
            {
                clrType.GetMethod("Initialize").Invoke(null, new object[] { appdomain });
            }
#else
            ILRuntime.Runtime.Generated.CLRBindings.Initialize(appdomain);
#endif
            ILRuntime.Runtime.Generated.UnityEngine_Debug_Binding.Register(appdomain);
            try
            {
                DllStream = CopyStream(ResLoad.GetStream("Data/DyncDll.dll"));
                if (DllStream != null)
                {
#if USE_PDB
                    SymbolStream = CopyStream(ResLoad.GetStream("Data/DyncDll.pdb"));
                    appdomain.LoadAssembly(DllStream, SymbolStream, new ILRuntime.Mono.Cecil.Pdb.PdbReaderProvider());
#elif USE_MDB
                    SymbolStream = CopyStream(ResLoad.GetStream("Data/DyncDll.mdb"));
                    appdomain.LoadAssembly(DllStream, SymbolStream, new ILRuntime.Mono.Cecil.Mdb.MdbReaderProvider());
#else
                    appdomain.LoadAssembly(DllStream);
#endif
                }
            }
            catch (System.Exception ex)
            {
                wxb.L.LogException(ex);
            }

            RegDelegate(appdomain);
            IL.Help.Init();
        }