MacroDefine.cs 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. namespace XGame.Framework
  2. {
  3. /// <summary>
  4. /// 宏定义
  5. /// </summary>
  6. public static class MacroDefine
  7. {
  8. //Release
  9. public const string FINAL_RELEASE = "FINAL_RELEASE";
  10. //Debug
  11. public const string DEBUG = "DEBUG";
  12. //Profiler
  13. public const string PROFILER = "PROFILER";
  14. //Editor
  15. public const string UNITY_EDITOR = "UNITY_EDITOR";
  16. public const string UNITY_EDITOR_WIN = "UNITY_EDITOR_WIN";
  17. public const string UNITY_EDITOR_OSX = "UNITY_EDITOR_OSX";
  18. //Standalone
  19. public const string UNITY_STANDALONE = "UNITY_STANDALONE";
  20. public const string UNITY_STANDALONE_WIN = "UNITY_STANDALONE_WIN";
  21. public const string UNITY_STANDALONE_OSX = "UNITY_STANDALONE_OSX";
  22. //Android
  23. public const string UNITY_ANDROID = "UNITY_ANDROID";
  24. //iOS
  25. public const string UNITY_IOS = "UNITY_IOS";
  26. //No_Try_Catch
  27. public const string NO_TRY_CATCH = "NO_TRY_CATCH";
  28. public const string XGAME_ASSERT = "XGAME_ASSERT";
  29. public static bool IsEditor
  30. {
  31. get
  32. {
  33. #if UNITY_EDITOR
  34. return true;
  35. #else
  36. return false;
  37. #endif
  38. }
  39. }
  40. public static bool IsEditorWin
  41. {
  42. get
  43. {
  44. #if UNITY_EDITOR_WIN
  45. return true;
  46. #else
  47. return false;
  48. #endif
  49. }
  50. }
  51. public static bool IsEditorOSX
  52. {
  53. get
  54. {
  55. #if UNITY_EDITOR_OSX
  56. return true;
  57. #else
  58. return false;
  59. #endif
  60. }
  61. }
  62. public static bool IsStandalone
  63. {
  64. get
  65. {
  66. #if UNITY_STANDALONE
  67. return true;
  68. #else
  69. return false;
  70. #endif
  71. }
  72. }
  73. public static bool IsStandaloneWin
  74. {
  75. get
  76. {
  77. #if UNITY_STANDALONE_WIN
  78. return true;
  79. #else
  80. return false;
  81. #endif
  82. }
  83. }
  84. public static bool IsStandaloneOSX
  85. {
  86. get
  87. {
  88. #if UNITY_STANDALONE_OSX
  89. return true;
  90. #else
  91. return false;
  92. #endif
  93. }
  94. }
  95. public static bool IsAndroid
  96. {
  97. get
  98. {
  99. #if UNITY_ANDROID
  100. return true;
  101. #else
  102. return false;
  103. #endif
  104. }
  105. }
  106. public static bool IsiOS
  107. {
  108. get
  109. {
  110. #if UNITY_IOS
  111. return true;
  112. #else
  113. return false;
  114. #endif
  115. }
  116. }
  117. public static bool IsRelease
  118. {
  119. get
  120. {
  121. #if FINAL_RELEASE
  122. return true;
  123. #else
  124. return false;
  125. #endif
  126. }
  127. }
  128. public static bool IsDebug
  129. {
  130. get
  131. {
  132. #if DEBUG
  133. return true;
  134. #else
  135. return false;
  136. #endif
  137. }
  138. }
  139. public static bool IsProfiler
  140. {
  141. get
  142. {
  143. #if PROFILER
  144. return true;
  145. #else
  146. return false;
  147. #endif
  148. }
  149. }
  150. }
  151. }