ReadJsons.cs 838 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. public class ReadJsons : MonoBehaviour
  5. {
  6. public static ReadJsons single;
  7. void Awake()
  8. {
  9. single = this;
  10. }
  11. ID ID;
  12. public int camera_id()
  13. {
  14. if (ID == null)
  15. {
  16. ID = ReadJosn.LoadJsonFromFile("Setting.json").ID;
  17. }
  18. // return 0;
  19. return int.Parse(ID.cameraid);
  20. }
  21. public int map_id()
  22. {
  23. if (ID == null)
  24. {
  25. ID = ReadJosn.LoadJsonFromFile("Setting.json").ID;
  26. }
  27. // return 0;
  28. return int.Parse(ID.mapid);
  29. }
  30. public int excel_id()
  31. {
  32. if (ID == null)
  33. {
  34. ID = ReadJosn.LoadJsonFromFile("Setting.json").ID;
  35. }
  36. //return 0;
  37. return int.Parse(ID.excelid);
  38. }
  39. }