Define.cs 1.3 KB

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