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
    
      }          
    }
  • 相关阅读:
    5.9编程练习
    linux下查看torch版本和cuda版本
    4.13编程练习
    C++ Primer Plus-3.7编程练习-第2题和第5题
    More on vim tips
    Method Calling in Perl
    换零钱 动态规划解法 C语言描述
    海伦平方根算法(LISP描述)
    expect 实现模拟交互
    tmux 入门
  • 原文地址:https://www.cnblogs.com/yangyxd/p/5241534.html
Copyright © 2011-2022 走看看