Пример #1
0
        public override void Dispose()
        {
            if (EngineConfig.DisplayingMinimap && minimapItem != null)
            {
                minimapItem.Dispose();
                minimapItem = null;
            }
            if (innerNode != null)
            {
                innerNode.DetachAllObjects();
                innerNode.Dispose();
                innerNode = null;
            }
            if (ammunitionModel != null)
            {
                ammunitionModel.Dispose();
                ammunitionModel = null;
            }
            missileAnimation = null;

            if (ammunitionNode != null)
            {
                ammunitionNode.DetachAllObjects();
                ammunitionNode.Dispose();
                ammunitionNode = null;
            }
        }
        private void DestroyGeometry()
        {
            if (collisionBody != null)
            {
                collisionBody.Dispose();
                collisionBody = null;
            }

            if (sceneNode != null)
            {
                sceneNode.Dispose();
                sceneNode = null;
            }

            if (meshObject != null)
            {
                meshObject.Dispose();
                meshObject = null;
            }

            if (mesh != null)
            {
                mesh.Dispose();
                mesh = null;
            }
        }
Пример #3
0
        /// <summary>
        /// This method detaches and dispode of all the elements of the compound model
        /// </summary>
        public void Dispose()
        {
            if (sphere != null)                     // Start removing from the leaves of the sub-graph
            {
                if (sphere.Parent != null)
                {
                    sphere.Parent.RemoveChild(sphere);
                }
                sphere.DetachAllObjects();
                sphere.Dispose();
                sphereEntity.Dispose();
            }

            if (mainHull != null)
            {
                if (mainHull.Parent != null)
                {
                    mainHull.Parent.RemoveChild(mainHull);
                }
                mainHull.DetachAllObjects();
                mainHull.Dispose();
                hullEntity.Dispose();
            }

            if (model != null)                      // Stop removing with the sub-graph root
            {
                if (model.Parent != null)
                {
                    model.Parent.RemoveChild(model);
                }
                model.Dispose();
            }
        }
Пример #4
0
 public void Dispose()
 {
     gemNode.Parent.RemoveChild(gemNode);
     gemNode.DetachAllObjects();
     gemNode.Dispose();
     gemEntity.Dispose();
 }
Пример #5
0
        public void Dispose()
        {
            wallNode1.DetachAllObjects();
            wallNode1.Parent.RemoveChild(wallNode1);
            wallNode1.Dispose();

            wallNode2.DetachAllObjects();
            wallNode2.Parent.RemoveChild(wallNode2);
            wallNode2.Dispose();

            //wallNode3.DetachAllObjects();
            //wallNode3.Parent.RemoveChild(wallNode3);
            //wallNode3.Dispose();

            //wallNode4.DetachAllObjects();
            //wallNode4.Parent.RemoveChild(wallNode4);
            //wallNode4.Dispose();

            wallMainNode.DetachAllObjects();
            wallMainNode.Parent.RemoveChild(wallMainNode);
            wallMainNode.Dispose();

            wallEntity1.Dispose();
            wallEntity2.Dispose();
            //wallEntity3.Dispose();
            //wallEntity4.Dispose();
        }
Пример #6
0
        protected override void DestroyScene()
        {
            base.DestroyScene();
            player.Model.GameNode.Dispose();
            robot.Dispose();
            cameraNode.DetachAllObjects();
            cameraNode.Dispose();

            foreach (Bomb bomb in testGun.bombs)
            {
                bomb.Dispose();
            }

            foreach (BlueGem blueGem in blueGems)
            {
                blueGem.Dispose();
            }

            foreach (RedGem redGem in redGems)
            {
                redGem.Dispose();
            }

            foreach (ShieldPU shield in shieldPU)
            {
                shield.Dispose();
            }

            hudElement.Dispose();
            physics.Dispose();
            environment.Dispose();
        }
Пример #7
0
        /// <summary>
        /// This method is detaches from the scene graph and derstroies the game node and the game entity
        /// </summary>
        public virtual void Dispose()
        {
            //Console.WriteLine("Delete Object");
            if (physObj != null)
            {
                Physics.RemovePhysObj(physObj);
                physObj = null;
                //Console.WriteLine("Delete Physics");
            }


            if (gameNode != null)
            {
                if (gameNode.Parent != null)
                {
                    gameNode.DetachAllObjects();
                    gameNode.RemoveAndDestroyAllChildren();
                    gameNode.Parent.RemoveChild(gameNode.Name);
                }
                gameNode.Dispose();
            }

            if (gameEntity != null)
            {
                gameEntity.Dispose();
            }
        }
Пример #8
0
 public void Dispose()
 {
     cubeNode.Parent.RemoveChild(cubeNode);
     cubeNode.DetachAllObjects();
     cubeNode.Dispose();
     cubeEntity.Dispose();
 }
Пример #9
0
 /// <summary>
 /// This method disposes of  the Cube
 /// </summary>
 public void Dispose()
 {
     groundNode.DetachAllObjects();
     groundNode.Parent.RemoveChild(groundNode);
     groundNode.Dispose();
     groundEntity.Dispose();
 }
Пример #10
0
        /// <summary>
        /// This method disposes of all noes and entities in the scene
        /// </summary>
        protected override void DestroyScene()
        {
            cameraNode.DetachAllObjects();
            cameraNode.Dispose();
            player.Model.Dispose();
            if (robot != null)
            {
                robot.Model.Dispose();
            }
            //cube.Dispose();
            gameHMD.Dispose();
            int a;

            for (a = 0; a < cubeNum; a++)
            {
                obstacle_cube[a].Dispose();
            }
            foreach (GemAmmo gemAmmo in gems_ammo)
            {
                gemAmmo.Dispose();
            }
            foreach (GemHealth gemHealth in gems_health)
            {
                gemHealth.Dispose();
            }
            physics.Dispose();
            base.DestroyScene();
        }
Пример #11
0
        protected override void OnUnload()
        {
            _cameraObject = null;

            // Detach and dispose the grouping scene node with all children.
            _groupNode.Parent.Children.Remove(_ambientLightNode);
            _groupNode.Dispose(false);

            // Dispose cloud textures.
            if (_enableCloudLayer)
            {
                _cloudMap0.Dispose();
                _cloudMap1.Dispose();
            }

            // Set all references to null.
            _groupNode         = null;
            _milkyWayNode      = null;
            _starfieldNode     = null;
            _sunNode           = null;
            _moonNode          = null;
            _scatteringSkyNode = null;
            _ambientLightNode  = null;
            _sunlightNode      = null;
            _moonlightNode     = null;
            _cloudLayerNode0   = null;
            _cloudLayerNode1   = null;
            _cloudMap0         = null;
            _cloudMap1         = null;
        }
Пример #12
0
        /// <summary>
        /// This method detaches and dispode of all the elements of the compound model
        /// </summary>
        public void Dispose()
        {
            if (wheelsGroupNode != null)                     // Start removing from the leaves of the sub-graph
            {
                if (wheelsGroupNode.Parent != null)
                {
                    wheelsGroupNode.Parent.RemoveChild(wheelsGroupNode);
                }
                wheelsGroupNode.DetachAllObjects();
                wheelsGroupNode.Dispose();
                sphere.Dispose();
            }

            if (hullGroupNode != null)
            {
                if (hullGroupNode.Parent != null)
                {
                    hullGroupNode.Parent.RemoveChild(hullGroupNode);
                }
                hullGroupNode.DetachAllObjects();
                hullGroupNode.Dispose();
                hull.Dispose();
            }

            if (model != null)                      // Stop removing with the sub-graph root
            {
                if (model.Parent != null)
                {
                    model.Parent.RemoveChild(model);
                }
                model.Dispose();
            }
        }
Пример #13
0
 /// <summary>
 /// Dispose method to remove the borderNode.
 /// </summary>
 public void Dispose()
 {
     borderNode.DetachAllObjects();
     borderNode.Parent.RemoveChild(borderNode);
     borderNode.Dispose();
     borderEntity.Dispose();
 }
Пример #14
0
        public void ClearGUI()
        {
            closing = true;

            if (hudOverlay != null)
            {
                hudOverlay.Hide();
                hudOverlay.Dispose();
            }
            if (!EngineConfig.DisplayMinimap)
            {
                return;
            }

            try
            {
                ammoContainer.Hide();
                livesContainer.Hide();
                scoreContainer.Hide();
                hiscoreContainer.Hide();
                infoContainer.Hide();

                OverlayManager.Singleton.DestroyOverlayElement(ammoElement);
                OverlayManager.Singleton.DestroyOverlayElement(livesElement);
                OverlayManager.Singleton.DestroyOverlayElement(scoreElement);
                OverlayManager.Singleton.DestroyOverlayElement(hiscoreElement);
                OverlayManager.Singleton.DestroyOverlayElement(infoElement);

                ammoContainer.Dispose();
                livesContainer.Dispose();
                hiscoreContainer.Dispose();
                scoreContainer.Dispose();
                infoContainer.Dispose();


                // sceneMgr.DestroyAllEntities();

                hudNode.Dispose();
                hudNode = null;
                fuelArrowNode.Dispose();
                fuelArrowNode = null;
                oilArrowNode.Dispose();
                oilArrowNode = null;

                /*
                 * ammoElement.Hide();
                 * ammoElement.Dispose();
                 * livesElement.Hide();
                 * livesElement.Dispose();
                 * scoreElement.Hide();
                 * scoreElement.Dispose();
                 * hiscoreElement.Hide();
                 * hiscoreElement.Dispose();*/
            }
            catch (Exception ex)
            {
                LogManager.Singleton.LogMessage(LogMessageLevel.LML_CRITICAL, "Exception while cleaning up indicator control (" + ex.Message + ") " + ex.StackTrace);
            }
        }
Пример #15
0
 /// <summary>
 // Disposes of the physObj and gamenode
 /// </summary>
 public override void Dispose()
 {
     base.Dispose();
     Physics.RemovePhysObj(PhysObj);
     physObj = null;
     gemNode.DetachAllObjects();
     gemNode.Dispose();
 }
 /// <summary>
 /// This method detaches the robot node from the scene graph and destroies it and the robot enetity
 /// </summary>
 public void Dispose()
 {
     robotNode.RemoveAllChildren();
     robotNode.Parent.RemoveChild(robotNode);
     robotNode.DetachAllObjects();
     robotNode.Dispose();
     robotEntity.Dispose();
 }
Пример #17
0
 private static void Dispose(SceneNode sceneNode)
 {
     if (sceneNode != null)
     {
         sceneNode.Parent?.Children.Remove(sceneNode);
         sceneNode.Dispose(false);
     }
 }
Пример #18
0
 public override void Dispose()
 {
     Physics.RemovePhysObj(physObj);
     physObj = null;
     //gameNode.Parent.RemoveChild(gameNode);
     gameNode.DetachAllObjects();
     gameNode.Dispose();
     gameEntity.Dispose();
 }
Пример #19
0
 public void Dispose()
 {
     entity.Dispose();
     entity = null;
     sizeEnity.Dispose();
     sizeEnity = null;
     minimapNode.Dispose();
     minimapNode = null;
 }
Пример #20
0
 public override void Dispose()
 {
     body.Dispose();
     body = null;
     mesh.Dispose();
     mesh = null;
     node.Dispose();
     node = null;
 }
Пример #21
0
 /// <summary>
 /// This method destroys the scene & components within it
 /// </summary>
 protected override void DestroyScene()
 {
     base.DestroyScene();
     gameHMD.Dispose();
     cameraNode.DetachAllObjects();
     cameraNode.Dispose();
     environment.Dispose();
     physics.Dispose();
 }
Пример #22
0
 /// <summary>
 /// This method detaches the robot node from the scene graph and destroies it and the robot enetity
 /// </summary>
 public override void Dispose()
 {
     Physics.RemovePhysObj(physObj);
     physObj = null;
     robotNode.Parent.RemoveChild(robotNode);
     robotNode.DetachAllObjects();
     robotNode.Dispose();
     robotEntity.Dispose();
 }
Пример #23
0
 void DestroyBackgroundImageMeshObject()
 {
     if (backgroundImageMeshObject != null)
     {
         backgroundImageMeshObject.Dispose();
         backgroundImageMeshObject = null;
         backgroundImageSceneNode.Dispose();
         backgroundImageSceneNode = null;
     }
 }
        /// <summary>
        /// This method dispose of the bomb, destroying the physics object, and removing the bomb and its mesh from the scenegraph
        /// </summary>
        public void Dispose()
        {
            Physics.RemovePhysObj(physObj);
            physObj = null;

            bombNode.Parent.RemoveChild(bombNode);
            bombNode.DetachAllObjects();
            bombNode.Dispose();
            bombEntity.Dispose();
        }
Пример #25
0
        /// <summary>
        /// This method remove from the 3D overlay and destries the passed scene node
        /// </summary>
        /// <param name="life"></param>
        private void RemoveAndDestroyLife(SceneNode life)
        {
            overlay3D.Remove3D(life);
            lives.Remove(life);
            MovableObject heart = life.GetAttachedObject(0);

            life.DetachAllObjects();
            life.Dispose();
            heart.Dispose();
        }
Пример #26
0
 public virtual void Dispose()
 {
     if (node != null)
     {
         node.ParentSceneNode.RemoveChild(node);
         node.RemoveAndDestroyAllChildren();
         ClearEntities();
         node.Dispose();
         node = null;
     }
 }
Пример #27
0
        /// <summary>
        /// This method detaches the robot node from the scene graph and destroies it and the robot enetity
        /// </summary>
        public void Dispose()
        {
            robotNode.RemoveAllChildren();
            robotNode.Parent.RemoveChild(robotNode);
            robotNode.DetachAllObjects();
            robotNode.Dispose();
            robotEntity.Dispose();

            Physics.RemovePhysObj(physObj);
            physObj = null;
        }
Пример #28
0
 void DestroyMeshObject()
 {
     if (meshObject != null)
     {
         sceneNode.Detach(meshObject);
         sceneNode.Dispose();
         sceneNode = null;
         meshObject.Dispose();
         meshObject = null;
     }
 }
Пример #29
0
 public override void Dispose()
 {
     Physics.RemovePhysObj(physObj);
     physObj = null;
     if (projectileNode.Parent != null)
     {
         projectileNode.Parent.RemoveChild(projectileNode);
     }
     projectileNode.DetachAllObjects();
     projectileNode.Dispose();
     projectileEntity.Dispose();
 }
 public override void Dispose()
 {
     Physics.RemovePhysObj(physObj);
     physObj = null;
     if (gemNode.Parent != null)
     {
         gemNode.Parent.RemoveChild(gemNode);
     }
     gemNode.DetachAllObjects();
     gemNode.Dispose();
     gemEntity.Dispose();
 }                                                                            /////////
Пример #31
0
 /// <summary>
 /// This method remove from the 3D overlay and destries the passed scene node
 /// </summary>
 /// <param name="life"></param>
 private void RemoveAndDestroyLife(SceneNode life)
 {
     overlay3D.Remove3D(life);
     lives.Remove(life);
     MovableObject heart = life.GetAttachedObject(0);
     life.DetachAllObjects();
     life.Dispose();
     heart.Dispose();
 }