Define.cs 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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 DEBUG
  8. public static bool IsDebug = true;
  9. #else
  10. public static bool IsDebug = false;
  11. #endif
  12. #if UNITY_EDITOR && !ASYNC
  13. public static bool IsAsync = false;
  14. #else
  15. public static bool IsAsync = true;
  16. #endif
  17. #if UNITY_EDITOR
  18. public static bool IsEditor = true;
  19. #else
  20. public static bool IsEditor = false;
  21. #endif
  22. #if ENABLE_CODES
  23. public static bool EnableCodes = true;
  24. #else
  25. public static bool EnableCodes = false;
  26. #endif
  27. #if ENABLE_VIEW
  28. public static bool EnableView = true;
  29. #else
  30. public static bool EnableView = false;
  31. #endif
  32. #if ENABLE_IL2CPP
  33. public static bool EnableIL2CPP = true;
  34. #else
  35. public static bool EnableIL2CPP = false;
  36. #endif
  37. public static UnityEngine.Object LoadAssetAtPath(string s)
  38. {
  39. #if UNITY_EDITOR
  40. return UnityEditor.AssetDatabase.LoadAssetAtPath<UnityEngine.Object>(s);
  41. #else
  42. return null;
  43. #endif
  44. }
  45. public static string[] GetAssetPathsFromAssetBundle(string assetBundleName)
  46. {
  47. #if UNITY_EDITOR
  48. return UnityEditor.AssetDatabase.GetAssetPathsFromAssetBundle(assetBundleName);
  49. #else
  50. return new string[0];
  51. #endif
  52. }
  53. public static string[] GetAssetBundleDependencies(string assetBundleName, bool v)
  54. {
  55. #if UNITY_EDITOR
  56. return UnityEditor.AssetDatabase.GetAssetBundleDependencies(assetBundleName, v);
  57. #else
  58. return new string[0];
  59. #endif
  60. }
  61. }
  62. }