Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
AnimationAsset.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 SiliconStudio.Assets;
4 using SiliconStudio.Assets.Compiler;
5 using SiliconStudio.Core;
6 using SiliconStudio.Paradox.DataModel;
7 
8 namespace SiliconStudio.Paradox.Assets.Model
9 {
10  [DataContract("Animation")]
11  [AssetFileExtension(FileExtension)]
12  [AssetCompiler(typeof(AnimationAssetCompiler))]
13  [AssetFactory(typeof(AnimationFactory))]
14  [ThumbnailCompiler(PreviewerCompilerNames.AnimationThumbnailCompilerQualifiedName)]
15  [AssetDescription("Animation", "A skeletal animation", false)]
16  public class AnimationAsset : AssetImport
17  {
18  /// <summary>
19  /// The default file extension used by the <see cref="AnimationAsset"/>.
20  /// </summary>
21  public const string FileExtension = ".pdxanim";
22 
23  /// <summary>
24  /// Gets or sets the animation repeat mode.
25  /// </summary>
26  /// <value>The repeat mode</value>
27  [DataMember(20)]
28  public AnimationRepeatMode RepeatMode { get; set; }
29 
30  /// <summary>
31  /// Create an instance of <see cref="AnimationAsset"/> with default values.
32  /// </summary>
33  public AnimationAsset()
34  {
35  RepeatMode = AnimationRepeatMode.LoopInfinite;
36  }
37 
38  private class AnimationFactory : IAssetFactory
39  {
40  public Asset New()
41  {
42  return new AnimationAsset();
43  }
44  }
45  }
46 }
Base class for Asset.
Definition: Asset.cs:14
Interface to create default instance of an asset type.
Definition: IAssetFactory.cs:8
AnimationRepeatMode
Enumeration describing how an animation should be repeated.
An importable asset.
Definition: AssetImport.cs:14
Contains user-friendly names and descriptions of an asset type.
AnimationAsset()
Create an instance of AnimationAsset with default values.