• Unity中各个平台的预编译的运用方式


    1,unity中官方文档的一个操纵关键词  


    Platform Dependent Compilation


    2,常用的预编译关键词
        
    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。


    3,具体的运用

    public class PlatformDefines : 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
    
      }          
    }
  • 相关阅读:
    HTML5 模板推荐
    OpenCV初探
    微信开放框架-UCToo
    ProFTPD 初探
    移动开发者服务平台-友盟
    线程原理理解
    JVM参数及性能调优
    GC——垃圾回收
    JVM内存模型
    php常用 随机数
  • 原文地址:https://www.cnblogs.com/yangyxd/p/5241534.html
Copyright © 2020-2023  润新知