-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathBuilder.cs
More file actions
64 lines (52 loc) · 2.14 KB
/
Builder.cs
File metadata and controls
64 lines (52 loc) · 2.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/// <summary>
/// Entry point for the Content Builder project,
/// which when executed will build content according to the "Content Collection Strategy" defined in the Builder class.
/// </summary>
/// <remarks>
/// Make sure to validate the directory paths in the "ContentBuilderParams" for your specific project.
/// For more details regarding the Content Builder, see the MonoGame documentation: <tbc.>
/// </remarks>
using Microsoft.Xna.Framework.Content.Pipeline;
using MonoGame.Framework.Content.Pipeline.Builder;
var contentCollectionArgs = new ContentBuilderParams()
{
Mode = ContentBuilderMode.Builder,
WorkingDirectory = $"{AppContext.BaseDirectory}../../../", // path to where your content folder can be located
SourceDirectory = "Assets", // Not actually needed as this is the default, but added for reference
Platform = TargetPlatform.DesktopGL
};
var builder = new Builder();
if (args is not null && args.Length > 0)
{
builder.Run(args);
}
else
{
builder.Run(contentCollectionArgs);
}
return builder.FailedToBuild > 0 ? -1 : 0;
public class Builder : ContentBuilder
{
public override IContentCollection GetContentCollection()
{
var contentCollection = new ContentCollection();
// By default, no content will be imported from the Assets folder using the default importer for their file type.
// Please define your content collection rules here.
/* Examples
// Import all content in the Assets folder using the default importer for their file type.
content.Include<WildcardRule>("*");
// Only copy content from the assets folder rather than build it with the pipeline.
content.IncludeCopy<WildcardRule>("*.json");
// Exclude assets that match the pattern., only required overriding a default import behaviour.
content.Exclude<WildcardRule>("Font/*.txt");
// Include a specific asset with processor parameters.
content.Include("Models/character.glb", new FbxImporter(),
new MeshAnimatedModelProcessor()
{
Scale = 100.0f
}
);
*/
return contentCollection;
}
}