Пример #1
0
        public virtual void Destroy()
        {
            FlatRedBall.SpriteManager.RemovePositionedObject(this);

            CannonballList.MakeOneWay();
            if (BoatSpriteInstance != null)
            {
                FlatRedBall.SpriteManager.RemoveSprite(BoatSpriteInstance);
            }
            if (Hitbox != null)
            {
                FlatRedBall.Math.Geometry.ShapeManager.Remove(Hitbox);
            }
            if (AnchorSpriteInstance != null)
            {
                FlatRedBall.SpriteManager.RemoveSprite(AnchorSpriteInstance);
            }
            for (int i = CannonballList.Count - 1; i > -1; i--)
            {
                CannonballList[i].Destroy();
            }
            CannonballList.MakeTwoWay();
            mGeneratedCollision.RemoveFromManagers(clearThis: false);
            CustomDestroy();
        }
Пример #2
0
        public virtual void Destroy()
        {
            if (Used)
            {
                Factories.TankFactory.MakeUnused(this, false);
            }
            FlatRedBall.SpriteManager.RemovePositionedObject(this);

            if (SpriteInstance != null)
            {
                FlatRedBall.SpriteManager.RemoveSpriteOneWay(SpriteInstance);
            }
            if (CircleInstance != null)
            {
                FlatRedBall.Math.Geometry.ShapeManager.RemoveOneWay(CircleInstance);
            }
            if (TurretInstance != null)
            {
                TurretInstance.Destroy();
                TurretInstance.Detach();
            }
            if (TankShadow != null)
            {
                FlatRedBall.SpriteManager.RemoveSpriteOneWay(TankShadow);
            }
            if (SmokeInstance != null)
            {
                SmokeInstance.Destroy();
                SmokeInstance.Detach();
            }
            mGeneratedCollision.RemoveFromManagers(clearThis: false);
            CustomDestroy();
        }
        public override void Destroy()
        {
            if (Used)
            {
                Factories.CannonProjectileFactory.MakeUnused(this, false);
            }
            base.Destroy();

            mGeneratedCollision.RemoveFromManagers(clearThis: false);
            CustomDestroy();
        }
Пример #4
0
        public virtual void Destroy()
        {
            FlatRedBall.SpriteManager.RemovePositionedObject(this);

            if (AxisAlignedRectangleInstance != null)
            {
                FlatRedBall.Math.Geometry.ShapeManager.Remove(AxisAlignedRectangleInstance);
            }
            mGeneratedCollision.RemoveFromManagers(clearThis: false);
            CustomDestroy();
        }
        public virtual void Destroy()
        {
            if (Used)
            {
                Factories.TileCollisionRectangleFactory.MakeUnused(this, false);
            }
            FlatRedBall.SpriteManager.RemovePositionedObject(this);

            if (AxisAlignedRectangleInstance != null)
            {
                FlatRedBall.Math.Geometry.ShapeManager.RemoveOneWay(AxisAlignedRectangleInstance);
            }
            mGeneratedCollision.RemoveFromManagers(clearThis: false);
            CustomDestroy();
        }
Пример #6
0
        public override void Destroy()
        {
            if (Used)
            {
                Factories.ElectricProjectileFactory.MakeUnused(this, false);
            }
            base.Destroy();

            if (AxisAlignedRectangleInstance != null)
            {
                FlatRedBall.Math.Geometry.ShapeManager.RemoveOneWay(AxisAlignedRectangleInstance);
            }
            mGeneratedCollision.RemoveFromManagers(clearThis: false);
            CustomDestroy();
        }
Пример #7
0
        public virtual void Destroy()
        {
            FlatRedBall.SpriteManager.RemovePositionedObject(this);

            if (SpriteInstance != null)
            {
                FlatRedBall.SpriteManager.RemoveSprite(SpriteInstance);
            }
            if (MeleeHitbox != null)
            {
                FlatRedBall.Math.Geometry.ShapeManager.Remove(MeleeHitbox);
            }
            mGeneratedCollision.RemoveFromManagers(clearThis: false);
            CustomDestroy();
        }
Пример #8
0
        public virtual void Destroy()
        {
            if (Used)
            {
                Factories.BulletFactory.MakeUnused(this, false);
            }
            FlatRedBall.SpriteManager.RemovePositionedObject(this);

            if (SpriteInstance != null)
            {
                FlatRedBall.SpriteManager.RemoveSpriteOneWay(SpriteInstance);
            }
            if (CollisionBox != null)
            {
                FlatRedBall.Math.Geometry.ShapeManager.RemoveOneWay(CollisionBox);
            }
            mGeneratedCollision.RemoveFromManagers(clearThis: false);
            CustomDestroy();
        }
        public override void Destroy()
        {
            if (Used)
            {
                Factories.Rabbit2EnemyFactory.MakeUnused(this, false);
            }
            base.Destroy();

            if (SpriteInstance != null)
            {
                FlatRedBall.SpriteManager.RemoveSpriteOneWay(SpriteInstance);
            }
            if (CircleInstance != null)
            {
                FlatRedBall.Math.Geometry.ShapeManager.RemoveOneWay(CircleInstance);
            }
            if (LightSprite != null)
            {
                FlatRedBall.SpriteManager.RemoveSpriteOneWay(LightSprite);
            }
            mGeneratedCollision.RemoveFromManagers(clearThis: false);
            CustomDestroy();
        }
Пример #10
0
        public virtual void Destroy()
        {
            FlatRedBall.SpriteManager.RemovePositionedObject(this);

            if (SpriteInstance != null)
            {
                FlatRedBall.SpriteManager.RemoveSprite(SpriteInstance);
            }
            if (TextInstance != null)
            {
                FlatRedBall.Graphics.TextManager.RemoveText(TextInstance);
            }
            if (Hitbox != null)
            {
                FlatRedBall.Math.Geometry.ShapeManager.Remove(Hitbox);
            }
            if (WeaponInstance != null)
            {
                WeaponInstance.Destroy();
                WeaponInstance.Detach();
            }
            mGeneratedCollision.RemoveFromManagers(clearThis: false);
            CustomDestroy();
        }
Пример #11
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();
        }