/// <summary> /// remove all scene nodes. /// </summary> public void UnloadBaseContent() { this.refScene3DRoot.RemoveAllChild(true); tracerBulletManager.UnloadContent(); tracerBulletManager = null; }
/// <summary> /// initializes this screen. /// </summary> public override void InitializeScreen() { this.refScene3DRoot.RemoveAllChild(true); this.refScene3DRoot.AddChild(this.GameLevel.SceneWorldRoot); this.refScene3DRoot.AddChild(this.GameLevel.SceneMechRoot); this.refScene3DRoot.AddChild(this.GameLevel.SceneParticleRoot); this.refScene3DRoot.AddChild(this.GameLevel.SceneCollisionRoot); RobotGameGame.CurrentStage = this; // Free Camera FreeCamera freeCamera = new FreeCamera(); freeCamera.SetView(new Vector3(0.0f, 0.0f, 10.0f), Vector3.Forward, Vector3.Up); freeCamera.SetPespective(MathHelper.PiOver4, (float)Viewer.ViewWidth, (float)Viewer.ViewHeight, 1.0f, 10000.0f); ViewCamera freeViewCamera = new ViewCamera(freeCamera, null); Viewer.AddCamera("Free", freeViewCamera); // PostScreen effect { paramCenterX = boosterEffect.Parameters["xCenter"]; paramCenterY = boosterEffect.Parameters["yCenter"]; paramTexWidth = boosterEffect.Parameters["texWidth"]; paramTexHeight = boosterEffect.Parameters["texHeight"]; paramWaveWidth = boosterEffect.Parameters["width"]; paramWaveMag = boosterEffect.Parameters["mag"]; paramBloomThreshold = postScreenEffect.Parameters["BloomThreshold"]; paramBloomIntensity = postScreenEffect.Parameters["BloomIntensity"]; paramBloomSaturation = postScreenEffect.Parameters["BloomSaturation"]; paramBaseIntensity = postScreenEffect.Parameters["BaseIntensity"]; paramBaseSaturation = postScreenEffect.Parameters["BaseSaturation"]; // Entry the post screen processing function FrameworkCore.RenderContext.RenderingPostDraw3D += OnPostDraw3DScreen; } // Tracer bullets { tracerBulletManager = new TracerBulletManager(); tracerBulletManager.AddBulletInstance(0, 32, "Particles/Spark_Horizontal01", RobotGameGame.CurrentGameLevel.SceneParticleRoot); } this.refScene3DRoot.Initialize(); // Create 2D Scene layer for Hud this.refRenderContext.CreateScene2DLayer(2); this.refSceneHudRoot = FrameworkCore.Scene2DLayers[0]; this.refSceneMissionRoot = FrameworkCore.Scene2DLayers[1]; #if DEBUG Vector2 pos = new Vector2(0, 20); pos = FrameworkCore.ClampSafeArea(pos); camPosition = FrameworkCore.TextManager.AddText(FrameworkCore.DebugFont, "CAM :", (int)pos.X, (int)pos.Y, Color.White); camPosition.Visible = true; #endif FrameworkCore.GameEventManager.Enable = true; }