Define.cs 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. namespace ET
  2. {
  3. public static class Define
  4. {
  5. public const string CodeDir = "Assets/Bundles/Code/";
  6. public const string BuildOutputDir = "Temp/Bin/Debug";
  7. #if UNITY_EDITOR && !ASYNC
  8. public static bool IsAsync = false;
  9. #else
  10. public static bool IsAsync = true;
  11. #endif
  12. #if UNITY_EDITOR
  13. public static bool IsEditor = true;
  14. #else
  15. public static bool IsEditor = false;
  16. #endif
  17. #if ENABLE_CODES
  18. public static bool EnableCodes = true;
  19. #else
  20. public static bool EnableCodes = false;
  21. #endif
  22. #if ENABLE_VIEW
  23. public static bool EnableView = true;
  24. #else
  25. public static bool EnableView = false;
  26. #endif
  27. #if ENABLE_IL2CPP
  28. public static bool EnableIL2CPP = true;
  29. #else
  30. public static bool EnableIL2CPP = false;
  31. #endif
  32. public static UnityEngine.Object LoadAssetAtPath(string s)
  33. {
  34. #if UNITY_EDITOR
  35. return UnityEditor.AssetDatabase.LoadAssetAtPath<UnityEngine.Object>(s);
  36. #else
  37. return null;
  38. #endif
  39. }
  40. public static string[] GetAssetPathsFromAssetBundle(string assetBundleName)
  41. {
  42. #if UNITY_EDITOR
  43. return UnityEditor.AssetDatabase.GetAssetPathsFromAssetBundle(assetBundleName);
  44. #else
  45. return new string[0];
  46. #endif
  47. }
  48. public static string[] GetAssetBundleDependencies(string assetBundleName, bool v)
  49. {
  50. #if UNITY_EDITOR
  51. return UnityEditor.AssetDatabase.GetAssetBundleDependencies(assetBundleName, v);
  52. #else
  53. return new string[0];
  54. #endif
  55. }
  56. }
  57. }