Exemple #1
0
    public static void injectLevel(string level)
    {
        DataBuildSettingProfilScenesMerger merger = HalperScriptables.getScriptableObjectInEditor <DataBuildSettingProfilScenesMerger>("everything");

        if (merger == null)
        {
            Debug.LogError("no merger for level " + level);
            return;
        }

        if (merger.levels == null)
        {
            Debug.LogError("no levels on merger " + merger.name);
            return;
        }

        for (int i = 0; i < merger.levels.Length; i++)
        {
            if (merger.levels[i].name.Contains(level))
            {
                merger.levels[i].add();
                return;
            }
        }

        Debug.LogWarning("didn't find to inject : " + level);
    }
Exemple #2
0
    public static void injectAll(string filter = "everything")
    {
        //DataBuildSettingProfilScenes scenes = HalperScriptables.getScriptableObjectInEditor<DataBuildSettingProfilScenes>("game_release");
        DataBuildSettingProfilScenesMerger merger = HalperScriptables.getScriptableObjectInEditor <DataBuildSettingProfilScenesMerger>(filter);

        merger.apply();

        Debug.Log("re-applied all scenes from scriptable " + merger.name, merger);
    }
Exemple #3
0
 static public DataBuildSettingVersion getVersion() => HalperScriptables.getScriptableObjectInEditor <DataBuildSettingVersion>("version");
Exemple #4
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);
        }