示例#1
0
    public static void CommandLineBuild()
    {
        EditorApplication.Beep();
        EditorApplication.Beep();
        EditorApplication.Beep();
        EditorApplication.Beep();
        EditorApplication.Beep();
        EditorApplication.Beep();
        EditorApplication.Beep();
        EditorApplication.Beep();
        EditorApplication.Beep();
        EditorApplication.Beep();
        EditorApplication.Beep();

        //make sure the recompiled scripts are reimported
        AssetDatabase.Refresh(ImportAssetOptions.ForceUpdate | ImportAssetOptions.ImportRecursive);

        //make a new scene
        EditorApplication.NewScene();

        //set the scene up with the single game object we have
        SceneSelector.LoadHangoutScene();

        //save the scene out
        EditorApplication.SaveScene(Application.dataPath + "/AutogeneratedScene");

        //set the resolution of the web build
        Screen.SetResolution(760, 500, false);

        //pass scene
        BuildPipeline.BuildPlayer(null, Application.dataPath + "/hangout.unity3d", BuildTarget.WebPlayer, BuildOptions.CompressTextures);
    }