zoukankan      html  css  js  c++  java
  • 判断不同IOS设备

    var iOSGen = iPhone.generation;
      
       
      
        if (Debug.isDebugBuild) {
      
            Debug.Log("iPhone.generation     : " + iPhone.generation);
      
            Debug.Log("SystemInfo.deviceType : " + SystemInfo.deviceType);
      
            Debug.Log("SystemInfo.deviceModel: " + SystemInfo.deviceModel);
      
        }
      
          
      
        if (iOSGen == iPhoneGeneration.iPhone3GS) {
      
            SetQualityLevel(2);
      
        } else if (iOSGen == iPhoneGeneration.iPhone4) {
      
            SetQualityLevel(3);
      
        } else if (iOSGen == iPhoneGeneration.iPhone4S) {
      
            SetQualityLevel(3);
      
        } else if (iOSGen == iPhoneGeneration.iPad1Gen) {
      
            SetQualityLevel(2);
      
        } else if (iOSGen == iPhoneGeneration.iPad2Gen) {
      
            SetQualityLevel(4);
      
        } else if (iOSGen == iPhoneGeneration.iPad3Gen) {
      
            SetQualityLevel(4);
      
        } else if (iOSGen == iPhoneGeneration.iPodTouch3Gen) {
      
            SetQualityLevel(3);    
      
        } else if (iOSGen == iPhoneGeneration.iPodTouch4Gen) {
      
            SetQualityLevel(3);    
      
        } else {
      
          
      
            if (Debug.isDebugBuild) { Debug.LogWarning("Can't detect iOS device type."); }
      
              
      
            var device : String = SystemInfo.deviceModel;
          // 调试device :ipad air =iPad4,1iphone 5 =iPhone5,2  所以 下面的判断是错误的  需要做字符串处理  
    if (device == "iPhone") { if (Debug.isDebugBuild) { Debug.Log("Device type iPhone"); } SetQualityLevel(4); } else if (device == "iPad") { if (Debug.isDebugBuild) { Debug.Log("Device type iPad"); } SetQualityLevel(4); } else if (device == "iPod") { if (Debug.isDebugBuild) { Debug.Log("Device type iPod"); } SetQualityLevel(3); } }

    或者:

    string id = "";
    if (deviceFlag == iPhoneGeneration.iPhone || deviceFlag == iPhoneGeneration.iPhone3G || deviceFlag == iPhoneGeneration.iPhone3GS|| deviceFlag == iPhoneGeneration.iPhone4
    || deviceFlag == iPhoneGeneration.iPhone4S || deviceFlag == iPhoneGeneration.iPhone5 || deviceFlag == iPhoneGeneration.iPhone5C || deviceFlag == iPhoneGeneration.iPhone5S
    || deviceFlag == iPhoneGeneration.iPhoneUnknown || deviceFlag == iPhoneGeneration.Unknown || deviceFlag == iPhoneGeneration.iPodTouch1Gen || deviceFlag ==iPhoneGeneration.iPodTouch2Gen
    || deviceFlag == iPhoneGeneration.iPodTouch3Gen || deviceFlag == iPhoneGeneration.iPodTouch4Gen || deviceFlag == iPhoneGeneration.iPodTouch5Gen || deviceFlag == iPhoneGeneration.iPodTouchUnknown
    )
    {
    id = "0";
    }
    if (deviceFlag == iPhoneGeneration.iPad1Gen || deviceFlag == iPhoneGeneration.iPad2Gen || deviceFlag == iPhoneGeneration.iPad3Gen || deviceFlag == iPhoneGeneration.iPad4Gen || deviceFlag == iPhoneGeneration.iPadMini1Gen || deviceFlag == iPhoneGeneration.iPadUnknown)
    {
    id = "1";
    }

     
  • 相关阅读:
    [Bhatia.Matrix Analysis.Solutions to Exercises and Problems]ExI.5.1
    [再寄小读者之数学篇](2014-11-21 关于积和式的一个不等式)
    简单的Slony-I设置实例
    Slony-I的限制
    PPAS上运行pg_dump经过II
    PPAS上运行pg_dump经过
    PL/pgSQL学习笔记之十一
    PL/pgSQL学习笔记之十
    PL/pgSQL学习笔记之九
    PL/pgSQL学习笔记之八
  • 原文地址:https://www.cnblogs.com/123ing/p/3835196.html
Copyright © 2011-2022 走看看