Beispiel #1
0
        // called when this prim is being destroyed and we should free all the resources
        public override void Destroy()
        {
            // MainConsole.Instance.DebugFormat("{0}: Destroy, id={1}", LogHeader, LocalID);
            IsInitialized = false;

            base.Destroy();

            // Undo any vehicle properties
            this.VehicleType = (int)Vehicle.TYPE_NONE;

            PhysicsScene.TaintedObject(LocalID, "BSPrim.Destroy", delegate()
            {
                DetailLog("{0},BSPrim.Destroy,taint,", LocalID);
                // If there are physical body and shape, release my use of same.
                PhysicsScene.Shapes.DereferenceBody(PhysBody, null);
                PhysBody.Clear();
                PhysShape.Dereference(PhysicsScene);
                PhysShape = new BSShapeNull();
            });
        }
Beispiel #2
0
        // called when this character is being destroyed and the resources should be released
        public override void Destroy()
        {
            base.Destroy();

            DetailLog("{0},BSCharacter.Destroy", LocalID);
            PhysicsScene.TaintedObject(LocalID,"BSCharacter.destroy", delegate()
            {
                PhysicsScene.Shapes.DereferenceBody(PhysBody, null /* bodyCallback */);
                PhysBody.Clear();
                PhysShape.Dereference(PhysicsScene);
                PhysShape = new BSShapeNull();
            });
        }