| 1234567891011121314151617181920212223242526272829303132 |
- using System;
- using System.Collections.Generic;
- using System.IO;
- using System.Reflection;
- namespace Model
- {
- public static class DllHelper
- {
- public static Assembly GetHotfixAssembly()
- {
- byte[] dllBytes = File.ReadAllBytes("./Hotfix.dll");
- #if __MonoCS__
- byte[] pdbBytes = File.ReadAllBytes("./Hotfix.dll.mdb");
- #else
- byte[] pdbBytes = File.ReadAllBytes("./Hotfix.pdb");
- #endif
- Assembly assembly = Assembly.Load(dllBytes, pdbBytes);
- return assembly;
- }
- public static Type[] GetBaseTypes()
- {
- List<Type> types = new List<Type>();
- foreach (Assembly assembly in Game.EntityEventManager.GetAssemblies())
- {
- types.AddRange(assembly.GetTypes());
- }
- return types.ToArray();
- }
- }
- }
|