untiy 自定預定義宏

  • 平臺相關的自定義的預定義宏
Other Settings 面板中,可以找到Scripting Define Symbols 輸入框,多個預定義以分號隔開。
  • 全局的自定義的預定義宏
也可以自定義像UNITY_EDITOR、UNITY_IOS這樣的全局宏,這需要在Assets文件夾下添加對應的.rsp文件。如 -define:UNITY_DEBUG
C# <Project Path>/Assets/smcs.rsp
C# - Editor Scripts <Project Path>/Assets/gmcs.rsp
UnityScript <Project Path>/Assets/us.rsp
  另外.rsp文件也需要與編譯器相對應。比如
  • when targeting the web player, smcs is used with smcs.rsp,
  • when targeting standalone players, gmcs is used with gmcs.rsp, and
  • when targeting MS compiler, csc is used with csc.rsp, etc.
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章