Define.cs 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. namespace ET
  2. {
  3. public static class Define
  4. {
  5. public const string BuildOutputDir = "./Temp/Bin/Debug";
  6. public const string LogicVersion = "LogicVersion.txt";
  7. // 1 mono模式 2 ILRuntime模式 3 mono热重载模式
  8. public static int CodeMode = 3;
  9. public const int CodeMode_Mono = 1;
  10. public const int CodeMode_ILRuntime = 2;
  11. public const int CodeMode_Reload = 3;
  12. #if UNITY_EDITOR && !ASYNC
  13. public static bool IsAsync = false;
  14. #else
  15. public static bool IsAsync = true;
  16. #endif
  17. #if UNITY_EDITOR
  18. public static bool IsEditor = true;
  19. #else
  20. public static bool IsEditor = false;
  21. #endif
  22. public static UnityEngine.Object LoadAssetAtPath(string s)
  23. {
  24. #if UNITY_EDITOR
  25. return UnityEditor.AssetDatabase.LoadAssetAtPath<UnityEngine.Object>(s);
  26. #else
  27. return null;
  28. #endif
  29. }
  30. public static string[] GetAssetPathsFromAssetBundle(string assetBundleName)
  31. {
  32. #if UNITY_EDITOR
  33. return UnityEditor.AssetDatabase.GetAssetPathsFromAssetBundle(assetBundleName);
  34. #else
  35. return new string[0];
  36. #endif
  37. }
  38. public static string[] GetAssetBundleDependencies(string assetBundleName, bool v)
  39. {
  40. #if UNITY_EDITOR
  41. return UnityEditor.AssetDatabase.GetAssetBundleDependencies(assetBundleName, v);
  42. #else
  43. return new string[0];
  44. #endif
  45. }
  46. }
  47. }