EnvVars.cs 964 B

123456789101112131415161718192021222324252627
  1. using System;
  2. namespace BepInEx.Preloader
  3. {
  4. /// <summary>
  5. /// Doorstop environment variables, passed into the BepInEx preloader.
  6. /// <para>https://github.com/NeighTools/UnityDoorstop/wiki#environment-variables</para>
  7. /// </summary>
  8. public static class EnvVars
  9. {
  10. /// <summary>
  11. /// Path to the assembly that was invoked via Doorstop. Contains the same value as in "targetAssembly" configuration option in the config file.
  12. /// </summary>
  13. public static string DOORSTOP_INVOKE_DLL_PATH { get; private set; }
  14. /// <summary>
  15. /// Full path to the game's "Managed" folder that contains all the game's managed assemblies
  16. /// </summary>
  17. public static string DOORSTOP_MANAGED_FOLDER_DIR { get; private set; }
  18. internal static void LoadVars()
  19. {
  20. DOORSTOP_INVOKE_DLL_PATH = Environment.GetEnvironmentVariable("DOORSTOP_INVOKE_DLL_PATH");
  21. DOORSTOP_MANAGED_FOLDER_DIR = Environment.GetEnvironmentVariable("DOORSTOP_MANAGED_FOLDER_DIR");
  22. }
  23. }
  24. }