Пример #1
0
        private void BuildAppOnly()
        {
            if (mBuildPlatform == BuildPlatform.Android)
            {
                BuildPlatformConfig config = AssetBuilderConfig.GetConfig(BuildPlatform.Android);
                string appSavePath         = "../app/" + config.platformName + "/";

                string        platformName   = mAppPlatform.ToString();
                string        gameConfigPath = string.Format(Directory.GetParent(UnityEngine.Application.dataPath) + "/PlatformData/{0}/android/config.game", platformName);
                string        json           = File.ReadAllText(gameConfigPath);
                AppGameConfig gameCfg        = AppGameConfig.FromJson(json);

                AssetBuilderCtrl.PackAndroidApp(config, appSavePath, platformName, mAppPackMode.ToString(), gameCfg, AssetBuilderConfig.IsSplashEnabled(mAppPlatform), AppResSize.Normal);
            }
            else if (mBuildPlatform == BuildPlatform.IOS)
            {
                BuildPlatformConfig config = AssetBuilderConfig.GetConfig(BuildPlatform.IOS);
                string appSavePath         = "../app/" + config.platformName + "/";

                string        platformName   = mAppPlatform.ToString();
                string        gameConfigPath = string.Format(Directory.GetParent(UnityEngine.Application.dataPath) + "/PlatformData/{0}/ios/config.game", platformName);
                string        json           = File.ReadAllText(gameConfigPath);
                AppGameConfig gameCfg        = AppGameConfig.FromJson(json);

                AssetBuilderCtrl.PackIOSApp(config, appSavePath, mAppPlatform.ToString(), mAppPackMode.ToString(), gameCfg, AppResSize.Normal);
            }
        }
Пример #2
0
        /// <summary>
        /// 设置安卓app的参数  外部调用
        /// </summary>
        public static void SetAndroidApp(BuildPlatformConfig config, string bundlePath, string appSavePath, string platformName, string packMode, AppResSize resSize = AppResSize.Normal, bool isSplashEnabled = true)
        {
            string gameConfigPath = string.Format(Directory.GetParent(UnityEngine.Application.dataPath) + "/PlatformData/{0}/android/config.game", platformName);

            string        json    = File.ReadAllText(gameConfigPath);
            AppGameConfig gameCfg = AppGameConfig.FromJson(json);

            if (Directory.Exists(SDKStreamingAssetsFull))
            {
                AssetBuilderCtrl.CleanDirectory(SDKStreamingAssetsFull);
            }
            else
            {
                Directory.CreateDirectory(SDKStreamingAssetsFull);
            }

            File.Copy(gameConfigPath, configGame_gameFull);
            AssetDatabase.Refresh();

            CopyAndroidPlugins(config, platformName, packMode);
            ReplaceAndroidManifestPushInfo(config, platformName, gameCfg);

            CopyAndroidAssets(config, platformName, packMode);

            SetAndroidAppBuildSetting(config, appSavePath, platformName, packMode, gameCfg, isSplashEnabled, resSize);
        }