/// <summary> /// Initializes this instance. /// </summary> /// <param name="game">The game.</param> public void Initialize(SampleWPFProject.Game game) { this.game = game; this.scene = WaveServices.ScreenContextManager.CurrentContext[0] as MyScene; this.EarthRadius = this.scene.Earth.FindComponent <Transform3D>().Scale.X; this.EarthDayLength = this.scene.Earth.FindComponent <OrbitBehavior>().DayTime; this.MoonRadius = this.scene.Moon.FindComponent <Transform3D>().Scale.X; this.MoonDayLength = this.scene.Moon.FindComponent <OrbitBehavior>().DayTime; this.MoonOrbitLength = this.scene.Moon.FindComponent <OrbitBehavior>().YearTime; this.MoonOrbitRadius = this.scene.Moon.FindComponent <OrbitBehavior>().Radius; this.SunLightIntensity = this.scene.Sun.Color.R / 255f; this.SunFlareRadius = this.scene.Sun.LensFlare.Scale; }
/// <summary> /// Called when [game loaded]. /// </summary> /// <param name="sender">The sender.</param> /// <param name="game">The game.</param> private void OnGameLoaded(object sender, Game game) { var viewModel = this.DataContext as SolarSystemViewModel; viewModel.Initialize(game); }