zoukankan      html  css  js  c++  java
  • 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
    
      }          
    }
  • 相关阅读:
    log4Net使用
    VS Code入门
    用VS Code写Python
    C#(99):LINQ查询操作符实例
    C#(99):LINQ to Objects(2)
    spring mvc 配置对静态资源的访问
    EntLib 自动数据库连接字符串加密
    块级格式化上下文( Block formatting contexts)
    Entlib DAAB映射枚举类型
    js 继承
  • 原文地址:https://www.cnblogs.com/yangyxd/p/5241534.html
Copyright © 2011-2022 走看看