Example #1
0
    // 打包
    static void BuildProject(BuildTarget target)
    {
        // 设置编译参数
        BuildSetScriptingBackend(target, CommandHelper.Arch);

        // Splash Screen
        {
            PlayerSettings.SplashScreen.show = false;
            //PlayerSettings.SplashScreen.show = true;
            //PlayerSettings.SplashScreen.showUnityLogo = false;
            //PlayerSettings.SplashScreen.backgroundColor = Color.black;

            //List<PlayerSettings.SplashScreenLogo> logos = new List<PlayerSettings.SplashScreenLogo>();
            //logos.Add(PlayerSettings.SplashScreenLogo.Create(2, AssetDatabase.LoadAssetAtPath<Sprite>("Assets/App/logo.png")));
            //PlayerSettings.SplashScreen.logos = logos.ToArray();
        }

        //PlayerSettings.bundleVersion = ConstantData.MainVersion;
        PlayerSettings.bundleVersion = CommandHelper.BundleVersion;

        switch (target)
        {
        case BuildTarget.iOS:
            PlayerSettings.productName = ConfigDataHelper.GameName;

            // 禁用自动签名
            PlayerSettings.iOS.appleEnableAutomaticSigning = false;
            PlayerSettings.iOS.buildNumber = ConfigDataHelper.RevisionGame.ToString();
            break;

        case BuildTarget.Android:
            PlayerSettings.productName = "zero";
            PlayerSettings.Android.useAPKExpansionFiles = CommandHelper.IsSplitResource;

            // 使用ETC
            //EditorUserBuildSettings.androidBuildSubtarget = MobileTextureSubtarget.ETC;
            //PlayerSettings.Android.bundleVersionCode = (int) ConfigDataHelper.RevisionGame;
            PlayerSettings.Android.bundleVersionCode = CommandHelper.BundleCode;

            PlayerSettings.Android.keystorePass = "******";
            PlayerSettings.Android.keyaliasPass = "******";
            PlayerSettings.Android.keystoreName = EditorHelper.GetProjPath("Tools/Keystore/user.keystore");
            break;

        default:
            // 其它,认为是Standalone
            break;
        }

        if (CommandHelper.IsBattleDebug)
        {
            CopyConfig();
        }

        BuildVersionWnd.CreateFullVersion(CommandHelper.PlatformPath, CommandHelper.PackagePath, CommandHelper.IsDevelopment, false, CommandHelper.IsBattleDebug, CommandHelper.IsApk);
    }
Example #2
0
        private void InitGUI()
        {
            const int itemW = 250;
            const int itemH = 17;

            List <Toggle> list = new List <Toggle>();
            Func <string, Action, Toggle> addItem =
                (label, act) => {
                Toggle item = new Toggle();
                item.Label = label;
                item.Data  = act;
                item.Rect  = new Rect(20, list.Count * itemH, itemW, itemH);
                list.Add(item);
                return(item);
            };

            //addItem("1.xlua生成", CSObjectWrapEditor.Generator.GenAll);
            addItem("1.序列化配置", Cfg2AssetsTool.EncodeAllCfg);
            //addItem("3.打AB包", BuildAssetBundle.Build);
            m_debugToggle = addItem("2.标记为Debug版本", null);
            m_apkToggle   = addItem("3.编译安装包", () => {
                BuildVersionWnd.SwitchPlatform(EditorUserBuildSettings.activeBuildTarget);
                BuildVersionWnd.CreateFullVersion("", "", m_debugToggle.Select, m_debugToggle.Select);
            });

            m_debugToggle.OnChange = OnChangeBuildDebug;
            m_apkToggle.OnChange   = OnChangeBuildApk;

            m_toggleArr = list.ToArray();

            m_createBtn.Rect.Set(10, 0, 120, 30);
            m_createBtn.Label   = "打包";
            m_createBtn.OnClick = OnClick;

            m_selAllBtn.Rect    = m_createBtn.Rect;
            m_selAllBtn.Rect.x  = m_createBtn.Rect.xMax + 10;
            m_selAllBtn.Label   = "选择全部";
            m_selAllBtn.OnClick = OnSelAllBtnClick;
        }