Define.cs 1.1 KB

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