ConfigLoader.cs 748 B

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