// 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("BSCharacter.destroy", delegate() { PhysicsScene.Shapes.DereferenceBody(PhysBody, null /* bodyCallback */); PhysBody.Clear(); PhysicsScene.Shapes.DereferenceShape(PhysShape, null /* bodyCallback */); PhysShape.Clear(); }); }
// called when this character is being destroyed and the resources should be released public override void Destroy() { IsInitialized = false; base.Destroy(); DetailLog("{0},BSCharacter.Destroy", LocalID); PhysScene.TaintedObject(LocalID, "BSCharacter.destroy", delegate() { PhysScene.Shapes.DereferenceBody(PhysBody, null /* bodyCallback */); PhysBody.Clear(); PhysShape.Dereference(PhysScene); PhysShape = new BSShapeNull(); }); }