Beispiel #1
0
        public override void RemoveComponent(Component comp)
        {
            Debug.Assert(comp is PhysicsComponent);

            PhysicsComponent physicsComp = comp as PhysicsComponent;
            //Remove from Farseer world

            if (_world.BodyList.Contains(physicsComp.Body))
                _world.RemoveBody(physicsComp.Body);

            //Remove from Components list
            if (Components.Contains(physicsComp))
            {
                Components.Remove(physicsComp);
            }
        }
Beispiel #2
0
 public DamageMessage(Component sender, float damage)
     : base(sender)
 {
     Damage = damage;
 }
Beispiel #3
0
 public AttackMessage(Component sender, bool melee)
     : base(sender)
 {
     Melee = melee;
 }
Beispiel #4
0
 /// <summary>
 /// Removes a Component from the GameObject
 /// </summary>
 /// <typeparam name="T">The Component type that will be removed.</typeparam>
 public void RemoveComponent(Component comp)
 {
     Components.Remove(comp);
 }
Beispiel #5
0
 /// <summary>
 /// Adds a Component to the GameObject.
 /// </summary>
 /// <typeparam name="T">The Component's type.</typeparam>
 /// <param name="component">The Component that is added.</param>
 public void AddComponent(Component comp)
 {
     Components.Add(comp);
 }
Beispiel #6
0
 public virtual void RemoveComponent(Component component)
 {
 }