Beispiel #1
0
    void StartEntry(Entry entry)
    {
        // Convert line breaks to space and remove commented out lines
        var lines = entry.arguments.Split(new String[] { "\r\n", "\n" }, StringSplitOptions.RemoveEmptyEntries).ToList();

        lines.RemoveAll(str => str.Contains("//"));
        var args = "";

        lines.ForEach(str => args += str + " ");

        int standaloneCount = entry.count;

        if (!Application.isPlaying && entry.runInEditor)
        {
            EditorLevelManager.StartGameInEditor(args);
            standaloneCount--;
        }

        for (var i = 0; i < standaloneCount; i++)
        {
            //if (allowDevBuild && entry.useDevBuild)
            //    RunDevBuild(args);
            //else
            BuildWindow.RunBuild(args + " -title \"" + entry.name + "\"");
        }
    }
Beispiel #2
0
    static void StartEntry(QuickstartEntry entry, string levelname, string defaultArguments)
    {
        var args = entry.GetArguments(levelname, defaultArguments);

        if (entry.runInEditor)
        {
            EditorLevelManager.StartGameInEditor(args);
        }
        else
        {
            RunBuild(args);
        }
    }
Beispiel #3
0
    void StartEntry(Entry entry)
    {
        var args = "";

        // Convert line breaks to space and remove commented out lines
        if (entry.arguments != null)
        {
            var lines = entry.arguments.Split(new String[] { "\r\n", "\n" }, StringSplitOptions.RemoveEmptyEntries).ToList();
            lines.RemoveAll(str => str.Contains("//"));
            lines.ForEach(str => args += str + " ");
        }

//        var config = entry.GetConfig();
//        if (config != null)
//        {
//            var configPath = AssetDatabase.GetAssetPath(config);
//            var fullPath = Path.GetFullPath(configPath);
//            args += " +exec " + fullPath;
//        }

        int standaloneCount = entry.count;

        if (!Application.isPlaying && entry.runInEditor)
        {
            EditorLevelManager.StartGameInEditor(args);
            standaloneCount--;
        }


        string buildPath;
        string buildName;
        var    result = entry.GetBuildName(out buildPath, out buildName);

        if (!result)
        {
            return;
        }
        var buildExe = buildName + ".exe";

        for (var i = 0; i < standaloneCount; i++)
        {
            RunBuild(buildPath, buildExe, args + " -title \"" + entry.name + "\"");
        }
    }
Beispiel #4
0
    public static void OnPostProcessScene()
    {
        // Only strip if building levels or if in preview mode in Editor
        if (BuildPipeline.isBuildingPlayer || Game.game == null)
        {
            LevelManager.StripCode(buildType, isDevelopmentBuild);
        }

        // In editor, we inject the game object to ensure preview mode works
        var info = EditorLevelManager.GetLevelInfoFor(EditorSceneManager.GetSceneAt(0).path);

        if (!BuildPipeline.isBuildingPlayer && Game.game == null && info != null && info.levelType != LevelInfo.LevelType.Generic)
        {
            var gamePrefab = AssetDatabase.LoadAssetAtPath("Assets/Prefabs/Game.prefab", typeof(GameObject));
            PrefabUtility.InstantiatePrefab(gamePrefab);
        }

        AddBuildInfo();
    }
Beispiel #5
0
    static AssetBundleBuild MakeSceneBundleBuild(UnityEngine.Object mainScene, string name)
    {
        var build = new AssetBundleBuild();

        build.assetBundleName    = name;
        build.assetBundleVariant = "";

        var path   = AssetDatabase.GetAssetPath(mainScene);
        var scenes = new List <string>();

        scenes.Add(path.ToLower());

        if (EditorLevelManager.IsLayeredLevel(path))
        {
            foreach (var l in EditorLevelManager.GetLevelLayers(path))
            {
                scenes.Add(l.ToLower());
            }
        }

        build.assetNames = scenes.ToArray();
        return(build);
    }