PathHelper.cs 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. using UnityEngine;
  2. namespace ET
  3. {
  4. public static class PathHelper
  5. { /// <summary>
  6. ///应用程序外部资源路径存放路径(热更新资源路径)
  7. /// </summary>
  8. public static string AppHotfixResPath
  9. {
  10. get
  11. {
  12. string game = Application.productName;
  13. string path = AppResPath;
  14. if (Application.isMobilePlatform)
  15. {
  16. path = $"{Application.persistentDataPath}/{game}/";
  17. }
  18. return path;
  19. }
  20. }
  21. /// <summary>
  22. /// 应用程序内部资源路径存放路径
  23. /// </summary>
  24. public static string AppResPath
  25. {
  26. get
  27. {
  28. return Application.streamingAssetsPath;
  29. }
  30. }
  31. /// <summary>
  32. /// 应用程序内部资源路径存放路径(www/webrequest专用)
  33. /// </summary>
  34. public static string AppResPath4Web
  35. {
  36. get
  37. {
  38. #if UNITY_IOS || UNITY_STANDALONE_OSX
  39. return $"file://{Application.streamingAssetsPath}";
  40. #else
  41. return Application.streamingAssetsPath;
  42. #endif
  43. }
  44. }
  45. }
  46. }