FlatRedBall.TileGraphics.LayeredTileMap.Destroy C# (CSharp) Метод

Destroy() публичный Метод

public Destroy ( ) : void
Результат void
        public void Destroy()
        {
            // Make it one-way because we want the 
            // contained objects to persist after a destroy
            mMapLists.MakeOneWay();

            for (int i = 0; i < mMapLists.Count; i++)
            {
                SpriteManager.RemoveDrawableBatch(mMapLists[i]);
            }

            SpriteManager.RemovePositionedObject(this);

            mMapLists.MakeTwoWay();
        }
    }

Usage Example

Пример #1
0
        public override void Destroy()
        {
            // Generated Destroy
            BulletFactory.Destroy();
            EnemyBulletFactory.Destroy();
            if (mStartLevel != null)
            {
                mStartLevel.Destroy();
                mStartLevel = null;
            }
            if (mLevel2 != null)
            {
                mLevel2.Destroy();
                mLevel2 = null;
            }
            if (mLevel3 != null)
            {
                mLevel3.Destroy();
                mLevel3 = null;
            }
            if (mLevel4 != null)
            {
                mLevel4.Destroy();
                mLevel4 = null;
            }
            if (mEndLevel != null)
            {
                mEndLevel.Destroy();
                mEndLevel = null;
            }

            BulletList.MakeOneWay();
            NextLevelEntityList.MakeOneWay();
            SignEntityList.MakeOneWay();
            ActionEntityList.MakeOneWay();
            EnemyBulletList.MakeOneWay();
            EnemyCornerList.MakeOneWay();
            GroundEnemyList.MakeOneWay();
            if (TiledMap != null)
            {
                TiledMap.Destroy();
            }
            if (TileCollisionShapes != null)
            {
                TileCollisionShapes.RemoveFromManagers(ContentManagerName != "Global");
            }
            for (int i = BulletList.Count - 1; i > -1; i--)
            {
                BulletList[i].Destroy();
            }
            for (int i = NextLevelEntityList.Count - 1; i > -1; i--)
            {
                NextLevelEntityList[i].Destroy();
            }
            if (PlayerInstance != null)
            {
                PlayerInstance.Destroy();
                PlayerInstance.Detach();
            }
            for (int i = SignEntityList.Count - 1; i > -1; i--)
            {
                SignEntityList[i].Destroy();
            }
            for (int i = ActionEntityList.Count - 1; i > -1; i--)
            {
                ActionEntityList[i].Destroy();
            }
            for (int i = EnemyBulletList.Count - 1; i > -1; i--)
            {
                EnemyBulletList[i].Destroy();
            }
            for (int i = EnemyCornerList.Count - 1; i > -1; i--)
            {
                EnemyCornerList[i].Destroy();
            }
            for (int i = GroundEnemyList.Count - 1; i > -1; i--)
            {
                GroundEnemyList[i].Destroy();
            }
            if (EntityCollisionShapes != null)
            {
                EntityCollisionShapes.RemoveFromManagers(ContentManagerName != "Global");
            }
            if (EnemyCollisionGround != null)
            {
                EnemyCollisionGround.RemoveFromManagers(ContentManagerName != "Global");
            }
            if (TheEndText != null)
            {
                TextManager.RemoveText(TheEndText);
            }
            BulletList.MakeTwoWay();
            NextLevelEntityList.MakeTwoWay();
            SignEntityList.MakeTwoWay();
            ActionEntityList.MakeTwoWay();
            EnemyBulletList.MakeTwoWay();
            EnemyCornerList.MakeTwoWay();
            GroundEnemyList.MakeTwoWay();

            base.Destroy();

            CustomDestroy();
        }