Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
MaterialAsset.cs
Go to the documentation of this file.
1 // Copyright (c) 2014 Silicon Studio Corp. (http://siliconstudio.co.jp)
2 // This file is distributed under GPL v3. See LICENSE.md for details.
3 using System;
4 using System.ComponentModel;
5 
6 using SiliconStudio.Assets;
7 using SiliconStudio.Assets.Compiler;
8 using SiliconStudio.Core;
9 using SiliconStudio.Core.IO;
10 
11 namespace SiliconStudio.Paradox.Assets.Materials
12 {
13  /// <summary>
14  /// Description of a material.
15  /// </summary>
16  [DataContract("MaterialAsset")]
17  [AssetFileExtension(FileExtension)]
18  [ThumbnailCompiler(PreviewerCompilerNames.MaterialThumbnailCompilerQualifiedName)]
19  [AssetCompiler(typeof(MaterialAssetCompiler))]
20  [AssetFactory(typeof(MaterialFactory))]
21  [AssetDescription("Material", "A material", true)]
22  public sealed class MaterialAsset : Asset
23  {
24  /// <summary>
25  /// The default file extension used by the <see cref="MaterialAsset"/>.
26  /// </summary>
27  public const string FileExtension = ".pdxmat";
28 
29  /// <summary>
30  /// Initializes a new instance of the <see cref="MaterialAsset"/> class.
31  /// </summary>
32  public MaterialAsset()
33  {
34  BuildOrder = 250;
35  }
36 
37  [Obsolete]
38  [DataMember(10)]
39  [DefaultValue(null)]
40  [Browsable(false)]
41  public UFile Source { get; set; }
42 
43  /// <summary>
44  /// The material.
45  /// </summary>
46  [DataMember(20)]
47  public MaterialDescription Material { get; set; }
48 
49  private class MaterialFactory : IAssetFactory
50  {
51  public Asset New()
52  {
53  var newMaterial = new MaterialAsset { Material = new MaterialDescription() };
54  return newMaterial;
55  }
56  }
57  }
58 }
Base class for Asset.
Definition: Asset.cs:14
Interface to create default instance of an asset type.
Definition: IAssetFactory.cs:8
MaterialAsset()
Initializes a new instance of the MaterialAsset class.
Contains user-friendly names and descriptions of an asset type.
Defines a normalized file path. See UPath for details. This class cannot be inherited.
Definition: UFile.cs:13