示例#1
0
 /// <summary>
 /// Overrides the entity's animation.
 /// </summary>
 /// <param name="component">The component that's to be in charge of the animation.</param>
 /// <param name="animation">The animation to use as the override.</param>
 public virtual void OverrideAnimation(Component component, Animation animation)
 {
     IsAnimationOverridden = true;
     ComponentInControl = component;
     CurrentAnimation = animation;
 }
示例#2
0
 /// <summary>
 /// Overrides the entity's animation.
 /// </summary>
 /// <param name="component">The component that's to be in charge of the animation..</param>
 /// <param name="id">The identifier of the animation to be pulled from the cache.</param>
 public virtual void OverrideAnimation(Component component, string id)
 {
     OverrideAnimation(component, AnimationCache.GetAnimation(id));
 }
示例#3
0
 /// <summary>
 /// Adds the component.
 /// </summary>
 /// <param name="id">The component's identifier.</param>
 /// <param name="component">The component to add.</param>
 public void AddComponent(string id, Component component)
 {
     Components.Add(id, component);
     component.Owner = this;
 }
示例#4
0
 /// <summary>
 /// Clears the animation override.
 /// </summary>
 public virtual void ClearAnimationOverride()
 {
     IsAnimationOverridden = false;
     ComponentInControl = null;
     HandleDerivedAnimation();
 }
示例#5
0
 /// <summary>
 /// Adds the component to the entity's list of components.
 /// </summary>
 /// <param name="component">The component to add.</param>
 public void AddComponent(Component component)
 {
     AddComponent(component.GetType().Name, component);
 }