Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
ModelNodeLinkComponent.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.Collections.Generic;
5 using System.Collections.Specialized;
6 using SiliconStudio.Core.Serialization.Converters;
7 using SiliconStudio.Core.Serialization.Serializers;
8 using SiliconStudio.Paradox.Effects;
9 using SiliconStudio.Paradox.Engine;
10 using SiliconStudio.Paradox.EntityModel;
11 using SiliconStudio.Paradox.Games;
12 using SiliconStudio.Core;
13 using SiliconStudio.Core.Collections;
14 using SiliconStudio.Core.Mathematics;
15 
16 namespace SiliconStudio.Paradox.Engine
17 {
18  [DataConverter(AutoGenerate = true)]
19  [DataContract("ModelNodeLinkComponent")]
21  {
23 
24  internal MeshProcessor.EntityLink EntityLink;
25  internal ModelNodeLinkProcessor Processor;
26  private ModelComponent target;
27  private string nodeName;
28 
29  /// <summary>
30  /// Gets or sets the model which contains the hierarchy to use.
31  /// </summary>
32  /// <value>
33  /// The model which contains the hierarchy to use.
34  /// </value>
35  [DataMemberConvert]
36  public ModelComponent Target
37  {
38  get
39  {
40  return target;
41  }
42  set
43  {
44  target = value;
45  UpdateDirty();
46  }
47  }
48 
49  /// <summary>
50  /// Gets or sets the name of the node.
51  /// </summary>
52  /// <value>
53  /// The name of the node.
54  /// </value>
55  [DataMemberConvert]
56  public string NodeName
57  {
58  get
59  {
60  return nodeName;
61  }
62  set
63  {
64  nodeName = value;
65  UpdateDirty();
66  }
67  }
68 
69  private void UpdateDirty()
70  {
71  var processor = Processor;
72  if (processor != null)
73  {
74  lock (processor.DirtyLinks)
75  {
76  processor.DirtyLinks.Add(this);
77  }
78  }
79  }
80 
81  public override PropertyKey DefaultKey
82  {
83  get { return Key; }
84  }
85  }
86 }
Base class for converters to/from a data type.
Add a Model to an Entity, that will be used during rendering.
A class that represents a tag propety.
Definition: PropertyKey.cs:17