Utils.cs 650 B

123456789101112131415161718192021222324252627282930313233
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using UnityEngine;
  6. /// <summary>
  7. /// 工具集
  8. /// </summary>
  9. public partial class Utils
  10. {
  11. /// <summary>
  12. /// 网络可用
  13. /// </summary>
  14. public static bool NetAvailable
  15. {
  16. get
  17. {
  18. return Application.internetReachability != NetworkReachability.NotReachable;
  19. }
  20. }
  21. /// <summary>
  22. /// 是否是无线
  23. /// </summary>
  24. public static bool IsWifi
  25. {
  26. get
  27. {
  28. return Application.internetReachability == NetworkReachability.ReachableViaLocalAreaNetwork;
  29. }
  30. }
  31. }