Esempio n. 1
0
        public virtual void Destroy()
        {
            for (var i = 0; i < Components.Count; i++)
            {
                var Component = Components[i];

                if (Component.GetType() == typeof(Collider))
                {
                    WorldCollision.RemoveCollider((Collider)Component);
                }

                if (Component.GetType() == typeof(Renderer))
                {
                    var Renderer = (Renderer)Component;

                    DrawableHandler.RemoveDrawable(Renderer.Drawable);
                }
            }

            World.RemoveEntity(this);
        }