Beispiel #1
0
        public void ExitDisposals()
        {
            PreviousTube = null;
            CurrentTube  = null;
            NextTube     = null;
            StartingTime = 0;
            TimeLeft     = 0;

            foreach (var entity in _contents.ContainedEntities.ToArray())
            {
                if (entity.TryGetComponent(out ICollidableComponent? collidable))
                {
                    collidable.CanCollide = true;
                }

                _contents.ForceRemove(entity);

                if (entity.Transform.Parent == Owner.Transform)
                {
                    ContainerHelpers.AttachParentToContainerOrGrid(entity.Transform);
                }
            }

            Owner.Delete();
        }
        public void ExitDisposals()
        {
            PreviousTube = null;
            CurrentTube  = null;
            NextTube     = null;
            StartingTime = 0;
            TimeLeft     = 0;

            foreach (var entity in _contents.ContainedEntities.ToArray())
            {
                _contents.ForceRemove(entity);

                if (entity.Transform.Parent == Owner.Transform)
                {
                    ContainerHelpers.AttachParentToContainerOrGrid(entity.Transform);
                }
            }

            Owner.Delete();
        }
Beispiel #3
0
        /// <inheritdoc />
        public bool Remove(IEntity toremove)
        {
            DebugTools.Assert(!Deleted);

            if (toremove == null)
            {
                return(true);
            }

            if (!CanRemove(toremove))
            {
                return(false);
            }
            InternalRemove(toremove);

            if (!toremove.IsValid())
            {
                return(true);
            }

            ContainerHelpers.AttachParentToContainerOrGrid(toremove.Transform);
            return(true);
        }