protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                GameObjectService.Objects.Remove(_grabObject);

                ParticleSystemService.ParticleSystems.Remove(_particleSystem0);
                ParticleSystemService.ParticleSystems.Remove(_particleSystem1);

                GraphicsScreen.Scene.Children.Remove(_particleSystemNode0);
                GraphicsScreen.Scene.Children.Remove(_particleSystemNode1);
                _particleSystemNode0.Dispose(false);
                _particleSystemNode1.Dispose(false);

                GraphicsScreen.Scene.Children.Remove(_meshNode0);
                GraphicsScreen.Scene.Children.Remove(_meshNode1);
                _meshNode0.Dispose(false);
                _meshNode1.Dispose(false);

                // Remove all rigid bodies and force effects.
                Simulation.RigidBodies.Remove(_rigidBody0);
                Simulation.RigidBodies.Remove(_rigidBody1);
            }

            base.Dispose(disposing);
        }
        // OnUnload() is called when the GameObject is removed from the IGameObjectService.
        protected override void OnUnload()
        {
            _meshNode.Parent.Children.Remove(_meshNode);
            _meshNode.Dispose(false);
            _meshNode = null;

            _rigidBody.Simulation.RigidBodies.Remove(_rigidBody);
            _rigidBody = null;
        }
Example #3
0
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                // Clean up.
                GraphicsScreen.Scene.Children.Remove(_meshNode);
                _meshNode.Dispose(false);
            }

            base.Dispose(disposing);
        }
Example #4
0
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                // Clean up.
                GraphicsScreen.Scene.Children.Remove(_meshNode);
                _meshNode.Dispose(false);
                _walkAnimationController.Stop();
            }

            base.Dispose(disposing);
        }
Example #5
0
        private void frmMain_FormClosed(object sender, FormClosedEventArgs e)
        {
            try
            {
                SaveProfile();
            }
            catch
            { }

            _networkStatusCheckTimer.Dispose();
            _node.Dispose();

            _profileManager.UnloadProfileMainForm(this);

            StopDebugging();
        }
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                _animationController.Stop();
                _animationController.Recycle();

                GraphicsScreen.Scene.Children.Remove(_dudeModel);
                _dudeModel.Dispose(false);

                GraphicsScreen.Scene.Children.Remove(_sky);
                _sky.Dispose(false);
            }

            base.Dispose(disposing);
        }
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                // Clean up.
                GameObjectService.Objects.Remove(_sandboxObject);
                GraphicsScreen.Scene.Children.Remove(_meshNode);
                _meshNode.Dispose(false);

                _ragdoll.RemoveFromSimulation();
                // Note: The physics simulation is automatically reset in the base class.

                Game.Components.Remove(_kinectWrapper);
            }

            base.Dispose(disposing);
        }
Example #8
0
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                // Clean up.
                GameObjectService.Objects.Remove(_sandboxObject);

                GraphicsScreen.Scene.Children.Remove(_meshNodeA);
                _meshNodeA.Dispose(false);

                GraphicsScreen.Scene.Children.Remove(_meshNodeB);
                _meshNodeB.Dispose(false);

                Game.Components.Remove(_kinectWrapper);
            }

            base.Dispose(disposing);
        }