Esempio n. 1
0
        private void OnGUI()
        {
            GUILayout.Label("Build halper", HalperGuiStyle.getWinTitle());

            DataBuildSettingsBridge bridge = BuildHelperBase.getScriptableDataBuildSettings();
            DataBuildSettingProfile cur    = bridge.getPlatformProfil();

            GUILayout.Label("platform : " + cur.getPlatformTarget());

            GUILayout.BeginHorizontal();
            GUILayout.Label("zip name :");
            GUILayout.TextArea(cur.getZipName());
            GUILayout.EndHorizontal();
        }
Esempio n. 2
0
        protected string getBuildName()
        {
            DataBuildSettingsBridge data = getScriptableDataBuildSettings();

            return(data.getPlatformProfil().build_prefix);
        }
Esempio n. 3
0
        protected void build_prep()
        {
            if (BuildPipeline.isBuildingPlayer)
            {
                return;
            }

            Debug.Log("now building app ; inc version ? " + version_increment);

            buildPlayerOptions = new BuildPlayerOptions();

            DataBuildSettingProfile profile = data.getPlatformProfil();

            if (profile == null)
            {
                Debug.LogError("no profile for current platform ?");
                return;
            }

            profile.apply();

            //DataBuildSettingProfileAndroid pAndroid = profile as DataBuildSettingProfileAndroid;
            //DataBuildSettingProfileIos pIos = profile as DataBuildSettingProfileIos;
            //DataBuildSettingProfileWindows pWindows = profile as DataBuildSettingProfileWindows;
            //DataBuildSettingProfileSwitch pSwitch = profile as DataBuildSettingProfileSwitch;

            //this will apply
            if (version_increment)
            {
                DataBuildSettingVersion v = HalperScriptables.getScriptableObjectInEditor <DataBuildSettingVersion>("version");
                v.incrementFix();
            }

            //apply everything (after inc)
            applySettings(profile);

            //buildPlayerOptions.scenes = new[] { "Assets/Scene1.unity", "Assets/Scene2.unity" };
            buildPlayerOptions.scenes = getScenePaths();
            //buildPlayerOptions.
            // === CREATE SOLVED BUILD PATH

            string absPath = profile.getBasePath();

            bool pathExists = Directory.Exists(absPath);

            if (!pathExists)
            {
                Directory.CreateDirectory(absPath);
                Debug.Log("  ... created : " + absPath);
            }

            // === INJECTING SOLVED PATH TO BUILD SETTINGS

            outputPath = absPath;

            //[project]_[version].[ext]
            absPath = Path.Combine(absPath, profile.getBuildFullName(true));

            Debug.Log("BuildHelper, saving build at : " + absPath);
            buildPlayerOptions.locationPathName = absPath;

            //will setup android or ios based on unity build settings target platform
            buildPlayerOptions.target = EditorUserBuildSettings.activeBuildTarget;

            if (profile.developement_build)
            {
                buildPlayerOptions.options |= BuildOptions.Development;
            }
            if (profile.scriptDebugging)
            {
                buildPlayerOptions.options |= BuildOptions.AllowDebugging;
            }
            if (auto_run)
            {
                buildPlayerOptions.options |= BuildOptions.AutoRunPlayer;
            }

            //BuildPipeline.BuildPlayer(buildPlayerOptions);
        }