Define.cs 1008 B

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