public void Remove <T>() where T : Component { if (Components.ContainsKey(typeof(T))) { Component component = Components[typeof(T)]; Components.Remove(typeof(T)); if (component is IUpdateable) { Updatables.Remove(component as IUpdateable); } if (component is IRenderable) { Renderables.Remove(component as IRenderable); } if (component is IDrawable) { Drawables.Remove(component as IDrawable); } } }
public virtual void Die() { Updatables.Remove(this); }
public override void Die() { Updatables.Remove(this); Drawables.Remove(this); }