CommonDataManager.cs 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. // using GFGGame;
  2. // using SimpleJSON;
  3. // using UnityEngine;
  4. // using YooAsset;
  5. //
  6. // public class CommonDataManager2 : Singleton<CommonDataManager2>
  7. // {
  8. // public static cfg.Tables Tables;
  9. //
  10. // protected override void Awake()
  11. // {
  12. // base.Awake();
  13. // DontDestroyOnLoad(gameObject);
  14. // }
  15. //
  16. // public void Init()
  17. // {
  18. // Tables = new cfg.Tables(LoadByteBuf);
  19. // }
  20. //
  21. // private JSONNode LoadByteBuf(string file)
  22. // {
  23. // var str = ReadStringSync(file);
  24. // if (string.IsNullOrEmpty(str))
  25. // {
  26. // Debug.LogError("load luban json failed:" + file);
  27. // return null;
  28. // }
  29. //
  30. // return JSON.Parse(str);
  31. // }
  32. //
  33. // public string ReadStringSync(string loc)
  34. // {
  35. // var handler = YooAssets.LoadAssetSync<Sprite>(loc);
  36. // if (handler == null)
  37. // {
  38. // return null;
  39. // }
  40. //
  41. // var data = handler.AssetObject as TextAsset;
  42. // return data != null ? data.text : null;
  43. // }
  44. // }