/// <summary>
        /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
        /// </summary>
        public override void Dispose()
        {
            foreach (var shape in colliderShapes)
            {
                InternalCompoundShape.RemoveChildShape(shape.InternalShape);
                shape.Dispose();
            }
            colliderShapes.Clear();

            base.Dispose();
        }
        /// <summary>
        /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
        /// </summary>
        public override void Dispose()
        {
            foreach (var shape in colliderShapes)
            {
                InternalCompoundShape.RemoveChildShape(shape.InternalShape);

                if (!shape.IsPartOfAsset)
                {
                    shape.Dispose();
                }
                else
                {
                    shape.Parent = null;
                }
            }
            colliderShapes.Clear();

            base.Dispose();
        }
Example #3
0
        /// <summary>
        /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
        /// </summary>
        public override void Dispose()
        {
            foreach (var shape in colliderShapes)
            {
                InternalCompoundShape.RemoveChildShape(shape.InternalShape);

                if (!shape.DoNotDispose && !Xenko.Engine.SceneSystem.physicsDoNotDisposeNextRemoval)
                {
                    shape.Dispose();
                }
                else
                {
                    shape.Parent = null;
                }
            }
            colliderShapes.Clear();

            base.Dispose();
        }
Example #4
0
        /// <summary>
        /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
        /// </summary>
        public override void Dispose()
        {
            foreach (var shape in colliderShapes)
            {
                InternalCompoundShape.RemoveChildShape(shape.InternalShape);

                if (!shape.DoNotDispose && !ColliderShape.DoNotDisposeAnyOnNextDetach)
                {
                    shape.Dispose();
                }
                else
                {
                    shape.Parent = null;
                }
            }
            colliderShapes.Clear();

            base.Dispose();
        }