Define.cs 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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. public static UnityEngine.Object LoadAssetAtPath(string s)
  27. {
  28. #if UNITY_EDITOR
  29. return UnityEditor.AssetDatabase.LoadAssetAtPath<UnityEngine.Object>(s);
  30. #else
  31. return null;
  32. #endif
  33. }
  34. public static string[] GetAssetPathsFromAssetBundle(string assetBundleName)
  35. {
  36. #if UNITY_EDITOR
  37. return UnityEditor.AssetDatabase.GetAssetPathsFromAssetBundle(assetBundleName);
  38. #else
  39. return new string[0];
  40. #endif
  41. }
  42. public static string[] GetAssetBundleDependencies(string assetBundleName, bool v)
  43. {
  44. #if UNITY_EDITOR
  45. return UnityEditor.AssetDatabase.GetAssetBundleDependencies(assetBundleName, v);
  46. #else
  47. return new string[0];
  48. #endif
  49. }
  50. }
  51. }