コード例 #1
0
    /// <summary>
    /// 預設IOS資料(取現在的PlayerSetting)
    /// </summary>
    private void DefaultSetIOS()
    {
        SDIOSSet aTmpSet = new SDIOSSet();

        // Resolution and Presentation
        aTmpSet.RequiresFullScreen             = PlayerSettings.iOS.requiresFullScreen;
        aTmpSet.StatusBarHidden                = PlayerSettings.statusBarHidden;
        aTmpSet.StatusBarStyle                 = PlayerSettings.iOS.statusBarStyle;
        aTmpSet.ShowActivityIndicatorOnLoading = PlayerSettings.iOS.showActivityIndicatorOnLoading;
        // Debugging and crash reporting
        aTmpSet.ActionOnDotNetUnhandledException = PlayerSettings.actionOnDotNetUnhandledException;
        aTmpSet.LogObjCUncaughtExceptions        = PlayerSettings.logObjCUncaughtExceptions;
        aTmpSet.EnableCrashReportAPI             = PlayerSettings.enableCrashReportAPI;
        // Identification
        aTmpSet.BundleIDIOS = PlayerSettings.GetApplicationIdentifier(BuildTargetGroup.iOS);
        aTmpSet.BuildNumber = PlayerSettings.iOS.buildNumber;
        aTmpSet.AppleEnableAutomaticSigning = PlayerSettings.iOS.appleEnableAutomaticSigning;
        aTmpSet.AppleDeveloperTeamID        = PlayerSettings.iOS.appleDeveloperTeamID;
        aTmpSet.ProvisioningProfileID       = PlayerSettings.iOS.iOSManualProvisioningProfileID;
        // Configuration
        aTmpSet.ScriptingBackend        = PlayerSettings.GetScriptingBackend(BuildTargetGroup.iOS);
        aTmpSet.ApiCompatibilityLevel   = PlayerSettings.GetApiCompatibilityLevel(BuildTargetGroup.iOS);
        aTmpSet.TargetDevice            = PlayerSettings.iOS.targetDevice;
        aTmpSet.SDKVersion              = PlayerSettings.iOS.sdkVersion;
        aTmpSet.TargetOSVersionString   = PlayerSettings.iOS.targetOSVersionString;
        aTmpSet.PrepareIOSForRecording  = SDDataMove.GetBoolPlayerSetting("Prepare IOS For Recording");
        aTmpSet.RequiresPersistentWiFi  = PlayerSettings.iOS.requiresPersistentWiFi;
        aTmpSet.AppInBackgroundBehavior = PlayerSettings.iOS.appInBackgroundBehavior;
        aTmpSet.Architecture            = PlayerSettings.GetArchitecture(BuildTargetGroup.iOS);
        // Optimization
        aTmpSet.ScriptCallOptimizationLevel = PlayerSettings.iOS.scriptCallOptimization;
        aTmpSet.StripEngineCode             = PlayerSettings.stripEngineCode;
        aTmpSet.StripLevel = PlayerSettings.strippingLevel;
        // Scripting Define Symbols
        aTmpSet.ScriptDefineSymblos = PlayerSettings.GetScriptingDefineSymbolsForGroup(BuildTargetGroup.iOS);
        // Icon
        aTmpSet.IconOverride = true;
        SDDataMove.GetIconsGroup(BuildTargetGroup.iOS, ref mUIUseImages.IosIcons, ref aTmpSet.DefIcons);
        aTmpSet.PrerenderedIcon = PlayerSettings.iOS.prerenderedIcon;
        // Splash Images
        int aEmumTotal = Enum.GetNames(typeof(eMobileSplashScreen)).Length;

        mUIUseImages.IOSSplashImages = new Texture2D[aEmumTotal];
        aTmpSet.SplashImages         = new string[aEmumTotal];
        for (int i = 0; i < aEmumTotal; i++)
        {
            aTmpSet.SplashImages[i] = SDDataMove.GetSplashScreenPath((eMobileSplashScreen)i, ref mUIUseImages.IOSSplashImages[i]);
        }
        //-------------------------------------------------
        // Unity5 New
        aTmpSet.GraphicsType = PlayerSettings.GetGraphicsAPIs(BuildTarget.iOS);
        // Set Down
        mShowSetInfo.IOSSet = aTmpSet;
    }
コード例 #2
0
    /// <summary>
    /// 預設Android資料(取現在的PlayerSetting)
    /// </summary>
    private void DefaultSetAndroid()
    {
        SDAndroidSet aTmpSet = new SDAndroidSet();

        // Resolution and Presentation
        aTmpSet.Use32BitDisplayBuffer          = PlayerSettings.use32BitDisplayBuffer;
        aTmpSet.disableDepthAndStencilBuffers  = PlayerSettings.Android.disableDepthAndStencilBuffers;
        aTmpSet.ShowActivityIndicatorOnLoading = PlayerSettings.Android.showActivityIndicatorOnLoading;
        // Identification
        aTmpSet.BundleIDAndroid = PlayerSettings.GetApplicationIdentifier(BuildTargetGroup.Android);
        aTmpSet.BundleCode      = PlayerSettings.Android.bundleVersionCode;
        aTmpSet.SdkVersions     = PlayerSettings.Android.minSdkVersion;
        // Configuration
        aTmpSet.TargetDevice          = PlayerSettings.Android.targetDevice;
        aTmpSet.ApiCompatibilityLevel = PlayerSettings.GetApiCompatibilityLevel(BuildTargetGroup.Android);
        aTmpSet.ForceInternet         = PlayerSettings.Android.forceInternetPermission;
        aTmpSet.ForceSDCard           = PlayerSettings.Android.forceSDCardPermission;
        // Publishing Settings
        // PlayerSettings 的keystoreName是完整的Keystore路徑
        // 撰寫工具上我希望盡可能簡單的把檔案都放在Assets裡面
        // 所以在取路徑的時候檢查拿掉專案Assets之前的路徑
        string aKeyStorePath = PlayerSettings.Android.keystoreName;
        int    aCheckNum     = aKeyStorePath.IndexOf("Assets", System.StringComparison.OrdinalIgnoreCase);

        if (aCheckNum > 0)
        {
            aKeyStorePath = aKeyStorePath.Remove(0, Application.dataPath.Length + 1);
        }

        aTmpSet.KeyStorePath      = aKeyStorePath;
        aTmpSet.KeyStorePassword  = PlayerSettings.Android.keystorePass;
        aTmpSet.KeyAlialsName     = PlayerSettings.Android.keyaliasName;
        aTmpSet.KeyAlialsPassword = PlayerSettings.Android.keyaliasPass;
        // Scripting Define Symbols
        aTmpSet.ScriptDefineSymblos = PlayerSettings.GetScriptingDefineSymbolsForGroup(BuildTargetGroup.Android);
        // Icon
        aTmpSet.IconOverride = true;
        SDDataMove.GetIconsGroup(BuildTargetGroup.Android, ref mUIUseImages.AndroidIcons, ref aTmpSet.DefIcons);
        // Splash Images
        aTmpSet.SplashImage       = SDDataMove.GetSplashScreenPath("androidSplashScreen", ref mUIUseImages.AndroidSplashImage);
        aTmpSet.SplashScreenScale = PlayerSettings.Android.splashScreenScale;
        //-------------------------------------------------
        // Unity5 New
        aTmpSet.GraphicsType = PlayerSettings.GetGraphicsAPIs(BuildTarget.Android);
        // Set Down
        mShowSetInfo.AndroidSet = aTmpSet;
    }
コード例 #3
0
    /// <summary>
    /// 讀取Splash圖示
    /// </summary>
    public static Texture2D[] LoadIOSSplashTexture(ref SDefineSet iSetting)
    {
        string[]    aSelectSplashs = iSetting.IOSSet.SplashImages;
        Texture2D[] aResultTexture = null;
        if (CheckImagePathIsEmpty(aSelectSplashs))
        {
            int aEmumTotal = Enum.GetNames(typeof(eMobileSplashScreen)).Length;
            aResultTexture = new Texture2D[aEmumTotal];
            aSelectSplashs = new string[aEmumTotal];
            for (int i = 0; i < aEmumTotal; i++)
            {
                aSelectSplashs[i] = SDDataMove.GetSplashScreenPath((eMobileSplashScreen)i, ref aResultTexture[i]);
            }

            iSetting.IOSSet.SplashImages = aSelectSplashs;
            return(aResultTexture);
        }

        try
        {
            aResultTexture = new Texture2D[aSelectSplashs.Length];
            for (int i = 0; i < aSelectSplashs.Length; i++)
            {
                if (string.IsNullOrEmpty(aSelectSplashs[i]))
                {
                    continue;
                }

                Texture2D aTmpSplash = (Texture2D)AssetDatabase.LoadAssetAtPath(aSelectSplashs[i], typeof(System.Object));
                aResultTexture[i] = aTmpSplash;
            }
            Debug.Log("GetFinish.");
            iSetting.IOSSet.SplashImages = aSelectSplashs;
            return(aResultTexture);
        }
        catch (Exception e)
        {
            Debug.LogError("Load Icon temp data error:\n" + e.Message);
            return(aResultTexture);
        }
    }
コード例 #4
0
    public static Texture2D LoadAndroidSplashTexture(ref SDefineSet iSetting)
    {
        string[] aSelectSplashs = new string[1];
        aSelectSplashs[0] = iSetting.AndroidSet.SplashImage;
        Texture2D aResultTexture = null;

        if (CheckImagePathIsEmpty(aSelectSplashs))
        {
            aSelectSplashs    = new string[1];
            aSelectSplashs[0] = SDDataMove.GetSplashScreenPath("androidSplashScreen", ref aResultTexture);

            iSetting.AndroidSet.SplashImage = aSelectSplashs[0];
            return(aResultTexture);
        }

        try
        {
            for (int i = 0; i < aSelectSplashs.Length; i++)
            {
                if (string.IsNullOrEmpty(aSelectSplashs[i]))
                {
                    continue;
                }

                Texture2D aTmpSplash = (Texture2D)AssetDatabase.LoadAssetAtPath(aSelectSplashs[i], typeof(System.Object));
                aResultTexture = aTmpSplash;
            }
            Debug.Log("GetFinish.");
            iSetting.AndroidSet.SplashImage = aSelectSplashs[0];
            return(aResultTexture);
        }
        catch (Exception e)
        {
            Debug.LogError("Load Icon temp data error:\n" + e.Message);
            return(aResultTexture);
        }
    }