LoadConfigHelper.cs 783 B

123456789101112131415161718192021222324252627
  1. using System.Collections.Generic;
  2. using System.IO;
  3. using UnityEngine;
  4. namespace ET
  5. {
  6. public static class LoadConfigHelper
  7. {
  8. public static void GetAllConfigBytes(Dictionary<string, byte[]> output)
  9. {
  10. Dictionary<string, UnityEngine.Object> keys = ResourcesComponent.Instance.GetBundleAll("config.unity3d");
  11. foreach (var kv in keys)
  12. {
  13. TextAsset v = kv.Value as TextAsset;
  14. string key = kv.Key;
  15. output[key] = v.bytes;
  16. }
  17. }
  18. public static byte[] GetOneConfigBytes(string configName)
  19. {
  20. TextAsset v = ResourcesComponent.Instance.GetAsset("config.unity3d", configName) as TextAsset;
  21. return v.bytes;
  22. }
  23. }
  24. }