ConfigHelper.cs 388 B

12345678910111213141516171819202122
  1. using System;
  2. using Model;
  3. using UnityEngine;
  4. namespace Hotfix
  5. {
  6. public static class ConfigHelper
  7. {
  8. public static string GetText(string key)
  9. {
  10. try
  11. {
  12. string configStr = ((GameObject) Resources.Load("Config")).Get<TextAsset>(key).text;
  13. return configStr;
  14. }
  15. catch (Exception e)
  16. {
  17. throw new Exception($"load config file fail, key: {key}", e);
  18. }
  19. }
  20. }
  21. }