Define.cs 946 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. namespace ET
  2. {
  3. public static class Define
  4. {
  5. #if UNITY_EDITOR && !ASYNC
  6. public static bool IsAsync = false;
  7. #else
  8. public static bool IsAsync = true;
  9. #endif
  10. #if UNITY_EDITOR
  11. public static bool IsEditor = true;
  12. #else
  13. public static bool IsEditor = false;
  14. #endif
  15. public static UnityEngine.Object LoadAssetAtPath(string s)
  16. {
  17. #if UNITY_EDITOR
  18. return UnityEditor.AssetDatabase.LoadAssetAtPath<UnityEngine.Object>(s);
  19. #else
  20. return null;
  21. #endif
  22. }
  23. public static string[] GetAssetPathsFromAssetBundle(string assetBundleName)
  24. {
  25. #if UNITY_EDITOR
  26. return UnityEditor.AssetDatabase.GetAssetPathsFromAssetBundle(assetBundleName);
  27. #else
  28. return new string[0];
  29. #endif
  30. }
  31. public static string[] GetAssetBundleDependencies(string assetBundleName, bool v)
  32. {
  33. #if UNITY_EDITOR
  34. return UnityEditor.AssetDatabase.GetAssetBundleDependencies(assetBundleName, v);
  35. #else
  36. return new string[0];
  37. #endif
  38. }
  39. }
  40. }