当前位置: 移动技术网 > 网络运营>服务器>Linux > Unity的预编译

Unity的预编译

2020年07月08日  | 移动技术网网络运营  | 我要评论

常用的预编译关键词
    
UNITY_EDITOR    编辑器调用。
UNITY_STANDALONE_OSX    专门为Mac OS(包括Universal,PPC和Intelarchitectures)平台的定义。
UNITY_DASHBOARD_WIDGET    Mac OS Dashboard widget (Mac OS仪表板小部件)。
UNITY_STANDALONE_WIN    Windows。
UNITY_STANDALONE_LINUX    Linux的独立的应用程序。
UNITY_STANDALONE    独立的平台(Mac,Windows或Linux)。
UNITY_WEBPLAYER    网页播放器(包括Windows和Mac Web播放器可执行文件)。
UNITY_WII    Wii游戏机平台。
UNITY_IPHONE    iPhone平台。
UNITY_ANDROID    Android平台。
UNITY_PS3    PlayStation 3。
UNITY_XBOX360    Xbox 360。
UNITY_NACL    谷歌原生客户端(使用这个必须另外使用UNITY_WEBPLAYER)。
UNITY_FLASH    Adobe Flash。

 

代码

public class TestPlatformDefines : MonoBehaviour {
  void Start () {

    #if UNITY_EDITOR
      Debug.Log("Unity Editor");
    #endif
    
    #if UNITY_IPHONE
      Debug.Log("Iphone");
    #endif

    #if UNITY_STANDALONE_OSX
    Debug.Log("Stand Alone OSX");
    #endif

    #if UNITY_STANDALONE_WIN
      Debug.Log("Stand Alone Windows");
    #endif

  }          
}

 

本文地址:https://blog.csdn.net/dilly123/article/details/107149515

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网