GeneratorConfig.cs 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Reflection;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. using UnityEngine;
  8. namespace HybridCLR.Generators
  9. {
  10. internal class GeneratorConfig
  11. {
  12. /// <summary>
  13. /// 目前已经根据热更新dll的依赖自动计算需要扫描哪些dll来收集桥接函数。
  14. /// 只要你的热更新以assembly def形式放到项目中,是不需要改这个的
  15. /// </summary>
  16. /// <returns></returns>
  17. public static List<string> GetExtraAssembiles()
  18. {
  19. return new List<string>
  20. {
  21. // "mscorlib",
  22. };
  23. }
  24. /// <summary>
  25. /// 暂时没有仔细扫描泛型,如果运行时发现有生成缺失,先手动在此添加类
  26. /// </summary>
  27. /// <returns></returns>
  28. public static List<Type> PrepareCustomGenericTypes()
  29. {
  30. return new List<Type>
  31. {
  32. typeof(Action<int, string, Vector3>),
  33. };
  34. }
  35. /// <summary>
  36. /// 如果提示缺失桥接函数,将提示缺失的签名加入到下列列表是简单的做法。
  37. /// 这里添加64位App缺失的桥接函数签名
  38. /// </summary>
  39. /// <returns></returns>
  40. public static List<string> PrepareCustomMethodSignatures64()
  41. {
  42. return new List<string>
  43. {
  44. "vi8i8",
  45. "i4i8i8i4i4i8i8",
  46. "i8i8S12",
  47. "S12i8S12",
  48. "S12i8S12S12",
  49. "i16i8i16i16",
  50. };
  51. }
  52. /// <summary>
  53. /// 如果提示缺失桥接函数,将提示缺失的签名加入到下列列表是简单的做法。
  54. /// 这里添加32位App缺失的桥接函数签名
  55. /// </summary>
  56. /// <returns></returns>
  57. public static List<string> PrepareCustomMethodSignatures32()
  58. {
  59. return new List<string>
  60. {
  61. "vi4i4",
  62. "S12i4S12S12",
  63. };
  64. }
  65. }
  66. }