HotfixHelper.cs 321 B

123456789101112131415
  1. using System;
  2. using System.Reflection;
  3. namespace Hotfix
  4. {
  5. public static class HotfixHelper
  6. {
  7. public static object Create(object old)
  8. {
  9. Assembly assembly = typeof(HotfixHelper).Assembly;
  10. string objectName = old.GetType().FullName;
  11. return Activator.CreateInstance(assembly.GetType(objectName));
  12. }
  13. }
  14. }