public override void Destroy()
        {
            base.Destroy();
            LoadingScreenGum.RemoveFromManagers();
            LoadingScreenGum = null;

            FlatRedBall.FlatRedBallServices.Game.TargetElapsedTime = TimeSpan.FromSeconds(mSavedTargetElapedTime);
            FlatRedBall.Math.Collision.CollisionManager.Self.Relationships.Clear();
            CustomDestroy();
        }
Beispiel #2
0
        public override void Destroy()
        {
            base.Destroy();
            MainMenuScreenGum.RemoveFromManagers();
            MainMenuScreenGum = null;

            if (ButtonPlay != null)
            {
                ButtonPlay.RemoveFromManagers();
            }
            if (ButtonSettings != null)
            {
                ButtonSettings.RemoveFromManagers();
            }
            if (ButtonQuit != null)
            {
                ButtonQuit.RemoveFromManagers();
            }
            if (ButtonBack != null)
            {
                ButtonBack.RemoveFromManagers();
            }
            if (MainContainer != null)
            {
                MainContainer.RemoveFromManagers();
            }
            if (SettingsContainer != null)
            {
                SettingsContainer.RemoveFromManagers();
            }
            if (SliderVolume != null)
            {
                SliderVolume.RemoveFromManagers();
            }
            if (TextVolumeLevel != null)
            {
                TextVolumeLevel.RemoveFromManagers();
            }
            if (ButtonSwitchFullscreen != null)
            {
                ButtonSwitchFullscreen.RemoveFromManagers();
            }
            if (ButtonApply != null)
            {
                ButtonApply.RemoveFromManagers();
            }
            FlatRedBall.Math.Collision.CollisionManager.Self.Relationships.Clear();
            CustomDestroy();
        }
Beispiel #3
0
        public override void Destroy()
        {
            base.Destroy();
            Factories.DockFactory.Destroy();
            Factories.CannonballFactory.Destroy();
            Factories.ExplosionFactory.Destroy();
            Factories.BulletFactory.Destroy();
            Factories.SkeletonFactory.Destroy();
            Terrain.Destroy();
            Terrain = null;
            GameScreenGum.RemoveFromManagers();
            GameScreenGum = null;

            BoatList.MakeOneWay();
            DockList.MakeOneWay();
            CannonballList.MakeOneWay();
            ExplosionList.MakeOneWay();
            BulletList.MakeOneWay();
            EnemyList.MakeOneWay();
            if (PlayerBoat != null)
            {
                PlayerBoat.Destroy();
                PlayerBoat.Detach();
            }
            for (int i = BoatList.Count - 1; i > -1; i--)
            {
                BoatList[i].Destroy();
            }
            for (int i = DockList.Count - 1; i > -1; i--)
            {
                DockList[i].Destroy();
            }
            if (PlayerInstance != null)
            {
                PlayerInstance.Destroy();
                PlayerInstance.Detach();
            }
            if (UIBoatLayer != null)
            {
                FlatRedBall.SpriteManager.RemoveLayer(UIBoatLayer);
            }
            if (SandCollision != null)
            {
                SandCollision.Visible = false;
            }
            if (WaterCollision != null)
            {
                WaterCollision.Visible = false;
            }
            if (DirtCollision != null)
            {
                DirtCollision.Visible = false;
            }
            if (HulkCollision != null)
            {
                HulkCollision.Visible = false;
            }
            if (RockCollision != null)
            {
                RockCollision.Visible = false;
            }
            for (int i = CannonballList.Count - 1; i > -1; i--)
            {
                CannonballList[i].Destroy();
            }
            if (SpeedMeter != null)
            {
                SpeedMeter.Destroy();
                SpeedMeter.Detach();
            }
            for (int i = ExplosionList.Count - 1; i > -1; i--)
            {
                ExplosionList[i].Destroy();
            }
            if (ButtonPistol != null)
            {
                ButtonPistol.RemoveFromManagers();
            }
            if (ButtonShotgun != null)
            {
                ButtonShotgun.RemoveFromManagers();
            }
            for (int i = BulletList.Count - 1; i > -1; i--)
            {
                BulletList[i].Destroy();
            }
            for (int i = EnemyList.Count - 1; i > -1; i--)
            {
                EnemyList[i].Destroy();
            }
            if (InventoryBar != null)
            {
                InventoryBar.RemoveFromManagers();
            }
            if (InventoryGui != null)
            {
                InventoryGui.RemoveFromManagers();
            }
            BoatList.MakeTwoWay();
            DockList.MakeTwoWay();
            CannonballList.MakeTwoWay();
            ExplosionList.MakeTwoWay();
            BulletList.MakeTwoWay();
            EnemyList.MakeTwoWay();
            FlatRedBall.Math.Collision.CollisionManager.Self.Relationships.Clear();
            CustomDestroy();
        }