Esempio n. 1
0
        /// <summary>
        /// Dispose all managers.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            if (fpsCounter != null)
            {
                fpsCounter = null;
            }

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

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

            inputManager = null;

            if (collisionContext != null)
            {
                collisionContext.ClearAllLayer();
                collisionContext = null;
            }

            if (particleManager != null)
            {
                particleManager.ClearAllParticles();
                particleManager = null;
            }

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

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

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

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

            if (debugFont != null)
            {
                debugFont = null;
            }

            base.Dispose(disposing);
        }