PathTool.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #if !COMBAT_SERVER
  2. using UnityEngine;
  3. using Utility;
  4. namespace CombatLibrary.CombatLibrary.CombatCore.AssetLoadTool
  5. {
  6. public class PathTool : Singleton<PathTool>
  7. {
  8. public string platformName;
  9. public string bundleStreamingAssetsPath;
  10. public string bundlePersistentAssetsPath;
  11. public string md5Name="md5File.txt";
  12. public PathTool()
  13. {
  14. platformName = GetPlatformFolderForAssetBundles();
  15. bundleStreamingAssetsPath = Application.streamingAssetsPath+"/"+platformName;
  16. bundlePersistentAssetsPath=Application.persistentDataPath+"/"+platformName;
  17. }
  18. public static string GetPlatformFolderForAssetBundles()
  19. {
  20. switch (Application.platform)
  21. {
  22. case RuntimePlatform.Android:
  23. return "Android";
  24. case RuntimePlatform.IPhonePlayer:
  25. return "iOS";
  26. //case RuntimePlatform.WindowsPlayer:
  27. case RuntimePlatform.WebGLPlayer:
  28. return "WebPlayer";
  29. case RuntimePlatform.WindowsPlayer:
  30. return "Windows";
  31. case RuntimePlatform.OSXPlayer:
  32. return "OSX";
  33. default:
  34. return "Unknown";
  35. }
  36. }
  37. }
  38. }
  39. #endif