AssistMethods.cs 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using LitJson;
  5. namespace FSAssist {
  6. public class AssistMethods {
  7. /*
  8. * 判断两个区域是否相交
  9. * 传入两个区域
  10. */
  11. public static bool IsRectContain(Vector3 minP1, Vector3 maxP1, Transform pos) {
  12. return false;
  13. }
  14. /*
  15. * 获取json中的数据
  16. */
  17. public static object Get(JsonData data, string key) {
  18. return null;
  19. }
  20. /*
  21. * 获取int数据
  22. */
  23. public static int ReadInt(JsonData data, string key) {
  24. // 首先判断key对应的值是否存在
  25. if (data[key] == null) {
  26. return 0;
  27. }
  28. return (int)data[key];
  29. }
  30. /*
  31. * 获取string数据
  32. */
  33. public static string ReadString(JsonData data, string key) {
  34. // 首先判断key对应的值是否存在
  35. if (data[key] == null) {
  36. return null;
  37. }
  38. return (string)data[key];
  39. }
  40. }
  41. }